Jump to content

Mavericks Tags - File and Email Tagging with Alfred 2 (updated to v1.4)


Recommended Posts

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.

Link to post

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.

Link to post

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.

Link to post
  • 1 month later...

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 by paulw
Link to post

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.

Link to post

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

Link to post
  • 1 month later...
  • 4 months later...

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!

Link to post
  • 4 weeks later...

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'"

Link to post
  • 4 years later...
  • 9 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...