Yojimbo Rating System
Friday the 13 of July, 2007 Filed in:
Technology
I wanted to rate my Yojimbo items just like I do my iTunes tracks. So, I wrote the following AppleScript to do the trick. It works by setting a special tag for the selected items. I personally like the bullet character (option–8), but you can edit the scripts to use any character you choose. If an item already has a rating tag then it is removed and the new tag is added.
Here is the script for giving the selected Yojimbo items a 5–star rating:
doScript()
on doScript()
tell application "Yojimbo"
set theSelection to selection
end tell
if (theSelection is missing value) then return
if ((count of theSelection) > 0) then
my removeYojimboTags(theSelection, {"•", "••", "•••", "••••", "••••"})
my addYojimboTags(theSelection, {"•••••"})
end if
end doScript
on addYojimboTags(theItems, theTags)
tell application "Yojimbo"
repeat with thisItem in theItems
add tags theTags to thisItem
end repeat
end tell
end addYojimboTags
on removeYojimboTags(theItems, theTags)
tell application "Yojimbo"
repeat with thisItem in theItems
remove tags theTags from thisItem
end repeat
end tell
end removeYojimboTags
Open this Script in Script Editor by clicking
here. This link only works with OS 10.3
or later.
Download the AppleScripts here.