I'm assuming you're on OS X 10.9 or greater as the Finder Tags function will not work on 10.8 and lower. I've created the following action on Yate v3.7 which was released today and I'm running on 10.10.
I've made the following assumptions:
- Mood is always set to the Finder tags.
- Rating is not changed unless at least one of green, red, yellow or gray is in the Finder tags.
- If more than one colour is in the Finder tags, the highest associated rating value is used.
- Any matched colour tag is removed from the Finder tags.
- Any Finder tag other than green, red, yellow or gray is not modified.
- I'm not sure about regional settings but on my Mac the monochrome tag is "Gray" not "Grey".
- You have to remember that the Finder tags are returned as a list with items separated by newline characters.
- When saving the original tags to Mood, I replace the \n character with a comma.
The following action works for me:
Force Grouped Execution
Save Finder tags to Variable 1
Copy the Variable 1 field to the Mood field
Replace "\n" in the Mood field with ","
Set Variable 2 to "gray,red,yellow,green"
Set Variable 4 to "1"
Repeat With Variable 5 for the list in field Variable 2 (Initial) string delimiter "," Run inline action 'Look for Finder Tags' grouped
Start Look for Finder Tags
Increment Variable 4
Test if the list in field Variable 1 delimiter "\n" contains '\v5' case insensitive remove
if true
Set the Rating field to "\v4"
Set Finder tags from Variable 1
endif
If you want to download the action it can be found at:
http://2manyrobots.com/actions/FinderTagsToRatings.zip
Unzip it and import it.
If you have not yet installed v3.7 do a "Check for Updates" and install the new release. Nothing in the action is new to 3.7 but v3.7 preferences are not backwards compatible.
|