File pdf based on first tag of multiple tags

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

File pdf based on first tag of multiple tags Fri Apr 17, 2015 10:17 am • by jsg8
I apologize if this has been answered in the forums, I couldn't find this question after several searches:

I would like to use Hazel to send any file I add to a folder to another already existing folder based on the first tag (in Yosemite) that has been assigned to the file. My files each have multiple tags.

My problem is that when I set up a series of rules in Hazel using "Contains Tags" with each rule corresponding to a different tag, the first rule in the list is always executed.
Thus, if I tag a file with the following: XYZ, ABC, LMN, Hazel executes the first rule (which, e.g., may specify what to do if the file has tag LMN) rather than acting on the first tag.

I could use rules saying that "If File contains Tag XYZ but not Tag ABC or TAG LMN...then move to folder XYZ" but with 30 or so tags, the set of possible combinations would be enormous.

I'm grateful for any help or suggestions.
jsg8
 
Posts: 1
Joined: Fri Apr 17, 2015 10:01 am

Unfortunately, Hazel doesn't have a way to pick out specific elements out of a list-type value (like tags). It is being considered for a future release. That said, there's a trick you can try. Something like:
Code: Select all
Tags contain match (•first tag)
(•first tag) is "xyz"

where •first tag is set to match "anything".

Since "first tag" is set to match "anything", it will just match the text of the first tag. Now that that tag is stored in •first tag, you can then add a condition to match the tag itself to whatever you want. Give that a try and post back if it doesn't work.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support