ctwise Posted December 12, 2013 Posted December 12, 2013 Here's something you can experiment with. - Use Homebrew to install 'tag' (https://github.com/jdberry/tag/). - Create a test file and tag it with a tag that's not in use on your system. - Create another test file and go to Finder. Bring up the info view and click in the tags area. If you start to type the name of your test tag, it'll autocomplete. Finder knows about it. - Look in the com.apple.finder.plist. The tag isn't in there. So _something_ is monitoring tags and keeping a running list of tags used on the system. It might be just in memory but I don't think so, because the list survives restarts. It might be just in Finder, it might be an unpublished system call. Curious.
ctwise Posted December 12, 2013 Posted December 12, 2013 It looks like there's a second file - ~/Library/SyncedPreferences/com.apple.finder.plist - that has a list of all of the "pure" tags, e.g., not a label that acts like a faux tag. Unfortunately, this list is only updated by Finder when you assign a tag to a file through Finder. If you tag a file and never interact with it through Finder then the tag doesn't show up in this file. Still, if you merge the contents of both preferences lists you'll get closer to a comprehensive tag list.
_mk_ Posted December 12, 2013 Author Posted December 12, 2013 I'll have a look at it. Thanks for sharing the info.
_mk_ Posted December 16, 2013 Author Posted December 16, 2013 The workflow was updated to version 1.3: New Features: ".taglist" command now uses mdfind to query all tags instead of the unreliable Finder plist. twinpeaks and thec13 2
kopischke Posted December 21, 2013 Posted December 21, 2013 Just for the record, Paul Kim, the developer of Hazel, struggled with the exact same issue when updating Hazel to manage Mavericks tags (I should know – I was the one reporting the issue to him ). AFAIK, he ended implementing the exact same solution…
_mk_ Posted December 26, 2013 Author Posted December 26, 2013 What the workflow does is: /usr/bin/mdfind -0 "(kMDItemUserTags == '*')" |xargs -0 mdls -name kMDItemUserTags |grep '^ ' |cut -c5- |cut -d , -f 1 |sort -u This queries all tagged files and then extracts the distinct tag names. I am a bit concerned about the performance if one has lots of tagged files. I hope that Apple will come up with an improved tagging support in the future.
fishpatrol Posted February 20, 2014 Posted February 20, 2014 I'd like to use this workflow to tag applications. I'm able to tag files and folders okay, but when I try to tag an application, I get an error: OSStatus error -5000. I would use tagged applications to create application sets, described here: http://www.macdrifter.com/2014/02/application-buckets-with-alfred-and-tags.html. Any ideas?
_mk_ Posted February 20, 2014 Author Posted February 20, 2014 It works if you select the application in Alfred's file browser and invoke the "Manage Tags" file action. I'll have a look why it's not working with the Finder selection.
fishpatrol Posted February 21, 2014 Posted February 21, 2014 Hmm, I think that's what I'm doing. Invoke Alfred, start typing the name of the application, then arrow-key to Manage Tags and hit enter. It brings up the Alfred pane with ".tags" ready to add. I type in a tag, hit enter, and up pops the error. Is that the wrong route? Thanks.
_mk_ Posted February 21, 2014 Author Posted February 21, 2014 After you have selected "Manage Tags" and hit ENTER, make sure to select "Add Tag" and hit ENTER. Then input the tag name and press ENTER again.
paulw Posted February 24, 2014 Posted February 24, 2014 (edited) How do you tag multiple files at once? Whether using Alfred's buffer, or selecting multiple files in Finder, the action "Manage Tags" doesn't display for me. Edit: I see it works with the hotkey. Is it possible to get the "Manage Tags" action working for multiple files as well? Edited February 24, 2014 by paulw
lidow Posted March 1, 2014 Posted March 1, 2014 I'm trying to figure out how to tag emails. No success so far. I've tried both select email --> press ⌘-⌥-\ # nothing happened, beeping sound for failure. select email --> open aflred --> type .tag --> enter tag # tag is applied on previously selected fie I can tag single file using select file --> press ⌘-⌥-\ --> manage tags --> add tag I cannot find how to do multiple files though.
_mk_ Posted March 1, 2014 Author Posted March 1, 2014 The workflow was updated to version 1.4: New Features: "Manage Tags" file actions now supports multiple files from Alfred's file buffer
_mk_ Posted March 1, 2014 Author Posted March 1, 2014 I'm trying to figure out how to tag emails. No success so far. I've tried both select email --> press ⌘-⌥-\ # nothing happened, beeping sound for failure. select email --> open aflred --> type .tag --> enter tag # tag is applied on previously selected fie I can tag single file using select file --> press ⌘-⌥-\ --> manage tags --> add tag I cannot find how to do multiple files though. The hotkey for tagging mails is ⌃⌥M
eijitokyo Posted April 30, 2014 Posted April 30, 2014 (edited) Great workflow!but in my system, Mac OS X 10.9.2 Japanese language, my all japanese tags are garbled.Do you have any idea? Thanks in advance. Edited May 2, 2014 by eijitokyo
sudopeople Posted September 15, 2014 Posted September 15, 2014 The workflow looks interesting. Will it autocomplete tags while they are typed? I too was wondering about this. I haven't dug too deeply but the autocomplete functionality is essentially broken but also completely unneeded. When searching for a tag "todo": .tagged tod ...Alfred's already filled with files matching any tag starting with "tod" (on my system, only the "todo" tag). Hitting TAB at this point autocompletes the first item's file name; I believe since it's a filefilter the item is treated as a file would be - which autofills "Grocery List.txt" intending to search for a tag with that name. In any case, the only reason you'd need TAB to autocomplete to the intended tag is if you were looking at multiple tags starting with, as an example, "tod" maybe like "todo" and "today". If that were the case, how would you expect TAB to react? Autocomplete the one with more files, or the one most recently used, or most frequently used? Any, I don't see a huge need for the tag autocompletion. ...what I would LOVE to see (FEATURE REQUEST!) is the ability to search for file/folder names that are tagged with X. The theoretical format would be like this: .tagged todo grocery list Now I'm not sure if OS X allows spaces in tags, I'll assume it does, so some sort of delimiter is probably needed in my example between "todo" and "grocery" - the colon is a likely choice since that can't be used in filenames. Ironically, I just realized it would be useful to have tags autocompleted for this operation. .tagged to[TAB]do: grocery Anyway. Thanks for all the work you've put into this workflow. It's been great to use!
deiga Posted October 9, 2014 Posted October 9, 2014 I get the following error when trying to tag an application on 10.9.5 "Processing output 'alfred.workflow.output.notification' with arg 'tag: The operation couldn’t be completed. (OSStatus error -5000.)Tag Startup added to file(s): Fresh.app'"
deiga Posted October 16, 2014 Posted October 16, 2014 Feature request: Add possibility to open all files/apps with a certain tag
Jasondm007 Posted October 29, 2018 Posted October 29, 2018 Out of curiosity, does this workflow still operate in Mojave (and Alfred 3, for that matter)? If not, what other tag management workflows or tools are people using? Thanks!
dfay Posted August 13, 2019 Posted August 13, 2019 You can just replace all the references in info.plist to Alfred 2 with Alfred & it will work. Except the .taglist is taking eons to complete.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now