patowod Posted April 26, 2017 Share Posted April 26, 2017 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 comment
vitor Posted April 26, 2017 Share Posted April 26, 2017 Hello and welcome, @patowod, Maybe you’re looking for LabelColor (disclaimer: I wrote it). It’s still supported and will continued to be for the foreseeable future. Link to comment
patowod Posted April 26, 2017 Author Share Posted April 26, 2017 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 comment
deanishe Posted April 27, 2017 Share Posted April 27, 2017 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. vitor 1 Link to comment
patowod Posted April 27, 2017 Author Share Posted April 27, 2017 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 comment
deanishe Posted April 27, 2017 Share Posted April 27, 2017 (edited) 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 April 28, 2017 by deanishe Thanks dfay Link to comment
patowod Posted April 27, 2017 Author Share Posted April 27, 2017 I'd sure be interested - would you post it including a small usage instruction? Link to comment
deanishe Posted April 27, 2017 Share Posted April 27, 2017 Here's the script. It's a command-line program with fairly detailed help. You'll need the Python docopt library to run it. Link to comment
dfay Posted April 28, 2017 Share Posted April 28, 2017 (edited) See also https://github.com/jdberry/tag But the really great idea is setting the file action (not file filter, correct?) to toggle, not just add. FWIW I use Finder for almost all my tagging -- using a keyboard shortcut as Dean suggests -- auto-completion is super fast. Edited April 28, 2017 by dfay ninjakttty 1 Link to comment
deanishe Posted April 28, 2017 Share Posted April 28, 2017 (edited) 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 April 28, 2017 by deanishe Link to comment
patowod Posted May 1, 2017 Author Share Posted May 1, 2017 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 comment
dfay Posted May 1, 2017 Share Posted May 1, 2017 (edited) 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 May 1, 2017 by dfay patowod 1 Link to comment
deanishe Posted May 2, 2017 Share Posted May 2, 2017 (edited) 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: 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 May 2, 2017 by deanishe Whoever wrote the IPB frontend is an idiot Link to comment
Hans Tammen Posted March 10, 2020 Share Posted March 10, 2020 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 comment
llityslife Posted April 16, 2020 Share Posted April 16, 2020 On 5/3/2017 at 6:35 AM, deanishe said: I have a bunch of File Actions, one per tag: 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 comment
deanishe Posted April 16, 2020 Share Posted April 16, 2020 3 hours ago, llityslife said: where can I find this workflow Nowhere, I'm afraid. I have never released it. Link to comment
llityslife Posted May 1, 2020 Share Posted May 1, 2020 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. Link to comment
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