I want to add an attribute, “tags”, to all image files and query them based on that.
I did every step in the workshop explaining that sort of process, including reindex
mkindex -t string image:tags
reindex -f -r /boot
I’ve also tried adding GIF:tags specifically. Regardless of what I try, including copying files, querying tags doesn’t return any results. Am I missing something?
Huh, I didn’t know adding “Media:tags” was necessary. Videos are also “media”, right? Will this add “tags” to them too? I thought the internal name of images was just image.
Yeah, no, it still doesn’t work.
mkindex -t string Media:tags
reindex -f -r /boot
The first thing I did was go in the file type editor, add the attribute “tags” to images, and edit that attribute in the tracker.
So as a test, I added an entirely new file type. Maybe I missed some step, but I can’t even query for that type because it’s not one of the options. I’ve done this before successfully, but now it mysteriously doesn’t work.
If I can’t get this to work easily, the average user wont be able to. I’m not saying that to be egotistical, I’m saying it to be realistic.
It’s not strictly necessary, but without doing that in the FileTypes prefs, you won’t see the attribute under the “Image” item in the Attributes menu of Tracker windows that have images in the folder.
You decide how to name the attribute. I chose “Media” because I reckoned it would be applicable to other file types besides images. You can add any attribute to any file you like. If you want the attribute to appear under a filetype in Tracker’s Attributes menu, you’ll have to add it to the file type (e.g. video) in the FileTypes prefs.
That’s the supertype “image”. The subtypes like JPG is “image/jpeg”.
The “internal name” I mentioned is the internal name of the new attribute “Media:tags”. You definitely need that to create the similarly named index and it’s the name of the attribute you add to your (image) files.
It does though. In the example it’s “DVDdb:title” etc.
We should try not to mix two topics. a) adding an extra attribute to an existing file type, b) creating a new file type.
For your new application/test filetype, you’ll need to restart Tracker to find the new entry in the Find panel.
Is quitting the tracker the same as restarting it? That’s what I’m trying on a clean install and it’s not working on it either. Also, I don’t have to add anything at all to the index for the option to appear in tracker. I assume this is because having an attribute and indexing it are different.
Tracker gets auto-restarted by the launch_daemon, so yes.
Not sure what’s going wrong on your end. I can replicate what’s in the attributes workshop, basically what I wrote in my first comment here, and it works…
I’ve gotten it to work. Tracker doesn’t automatically remove dead attributes which have been renamed or deleted. In fact, I don’t think there is a way to remove dead attributes.
edit:
Moving a column out of a window, is a fast way to get rid of columns you don’t need.
They are both optional. If you don’t set a “Name”, there’ll be no helpful text in Tracker’s “Kind” column.
The “Description” appears not to be visible in the system currently, and seems to be just information when working with the file type in the FileTypes preferences.
Tracker doesn’t remove your attributes when you changed or deleted them in the FileTypes preferences. And that’s good. Imagine you had a partition of nicely tagged images, then e.g. re-installed a fresh Haiku without those attributes set up. We wouldn’t want Tracker to remove all those tags.
You can remove attributes with the rmattr command in Terminal.
That’s of course just the display of those attributes in the current Tracker window. It doesn’t remove the actual attribute or its data from the files in that folder.