Jump to content

Convenient way to tag files with Alfred?


Recommended Posts

Hi everyone on the forum, 

 

I've been reading silent for a long time and love looking through the forums... Today though, I have to ask for some help... I remember having a workflow that made it easy to find and tag files using Alfred. It's been a long time and I can't seem to find anything that does the job quite right.  I know about the built in tag search but it seems as if I can't find any hint on tagging through Alfred. 

 

I only find rather old stuff or repos with a 404. Is there anybody out there that can help, or has a hint on convenient tagging within Alfred?

 

Cheers and thanks in advance for looking at this question

patowod

Link to post

Hi vitor, 

 

and thanks for the hint. This sure looks very handy but I'm more in for something like getting the selected file in finder (no problem) and adding e.g. a comma separated tag list or choose from already existing tags. It's pretty cumbersome to add tags to existing files through finder only…

 

Link to post

That's how it works (if I've understood you correctly). Use ⌘⌥\ (CMD+OPT+BACKSLASH) to open Alfred with your current Finder selection.

 

It's also extremely easy to edit tags directly in Finder if you add a keyboard shortcut for the Tags… menu item. Be sure to name it Tags… with a single ellipsis (press ⌥;) not Tags... with three periods.

Link to post

Ha! Thanks for the hint deanishe… 

 

I knew about ⌘⌥\ (CMD+OPT+BACKSLASH) but somehow didn't think of the way you proposed. Works like a charm and sure is a viable solution. Maybe someday there will be a pure Alfred workflow again, though. Thanks again :)

Link to post

AFAIK, there isn't a particularly easy way to get a list of all your tags (though this might have changed since I last looked).

 

I usually use Alfred for tagging files (unless I want to edit multiple tags at once—then I use Finder).

 

I've set up a File Action for each of the tags I commonly use that toggles the tag on/off, which allows me to hit CMD+OPT+\ and directly type the name of the tag.

 

This works better for me than a generic tagging workflow would, as the tagging script I wrote is smarter and allows me to toggle pairs of tags.

 

For example, my "Toggle watched tag" action assigns one of watched or unwatched, rather than just adding/removing a single tag.

 

If the script would be useful to anyone, I can post it. 

Edited by deanishe
Thanks dfay
Link to post
3 hours ago, dfay said:

But the really great idea is setting the file action (not file filter, correct?) to toggle, not just add.

 

Yup. Thanks for spotting the error!

 

The script also works as a filter, like grep.

Edited by deanishe
Link to post

Hi deanishe, thanks for linking your script. I have to admit I'm not too familiar with this level of detail. How would I set it up within Alfred? 

 

@dfay

tag looks great - are you just referencing it for command line usage, or are you using it with Alfred?

 

Link to post

I use it in Alfred file actions, mostly (I can't think offhand of any conventional workflows where I use it....).  

 

e.g. I have a file action "Move to Dropbox tagging current"

 

which runs the following bash script:

 

/opt/local/bin/tag -a current {query}
mv {query} '~/Dropbox/'

 

Edited by dfay
Link to post
On 01/05/2017 at 8:06 PM, patowod said:

Hi deanishe, thanks for linking your script. I have to admit I'm not too familiar with this level of detail. How would I set it up within Alfred?

 

I have a bunch of File Actions, one per tag:

w8RsZdO.png 

 

The "normal" ones are connected to a Run Script that looks like this (this example toggles the todo tag):

export PATH=$HOME/.dotfiles/bin:$PATH

tag -t todo -v "$@"

(The PATH business is because the scripts live in ~/.dotfiles/bin.)

 

The point of my tag script is that it toggles tags itself: you don't have to figure out for yourself whether the file already has a tag.

 

The killer feature, however, is the ability to toggle a pair of tags. This is the script that the Toggle watched tag File Action is connected to:

export PATH=$HOME/.dotfiles/bin:$PATH

filetypes -t video -v "$@" | tag -p unwatched watched -v

(filetypes is another script that filters files based on their type.)

 

As is it configured, the File Filter will replace an unwatched tag with watched, or if there is no unwatched tag, the script adds it.

Edited by deanishe
Whoever wrote the IPB frontend is an idiot
Link to post
  • 2 years later...

Hi,

 

I can't see the tags… menu in the Finder. Does that not exist in Mojave (10.14) anymore? 

 

I'm totally fine with tagging in Finder, as long as it works as "selecting a file in Finder -> shortcut -> typing tag name(s)".

 

However, I have a total blackout as I can't find a way to open the context menu in Alfred or Keyboard Maestro. Ugh...

 

Any ideas?

 

Hans

 

 

Link to post
  • 1 month later...
On 5/3/2017 at 6:35 AM, deanishe said:

 

I have a bunch of File Actions, one per tag:

w8RsZdO.png 

 

The "normal" ones are connected to a Run Script that looks like this (this example toggles the todo tag):


export PATH=$HOME/.dotfiles/bin:$PATH

tag -t todo -v "$@"

(The PATH business is because the scripts live in ~/.dotfiles/bin.)

 

The point of my tag script is that it toggles tags itself: you don't have to figure out for yourself whether the file already has a tag.

 

The killer feature, however, is the ability to toggle a pair of tags. This is the script that the Toggle watched tag File Action is connected to:


export PATH=$HOME/.dotfiles/bin:$PATH

filetypes -t video -v "$@" | tag -p unwatched watched -v

(filetypes is another script that filters files based on their type.)

 

As is it configured, the File Filter will replace an unwatched tag with watched, or if there is no unwatched tag, the script adds it.

It's great idea, where can I find this workflow, it is easy to tag any files, could it remove the tag for file?

Link to post
  • 2 weeks later...
On 4/16/2020 at 4:55 PM, deanishe said:

 

Nowhere, I'm afraid. I have never released it.

All right! It's useful to sort the files and folders with using your smart folder workflow. There I have many tags. I hope it can be released in the future. But maybe it cannot use my custom tag name.

 

 image.png.d9197f4b05343f16966807c93a677772.png 

Link to post

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...