I’m reminded of why I tried a number of times over the years to get a handle on AppleScript and why I quit each time. Discoverability seems almost impossible and the errors returned don’t help much. Each thing I try to do just gets me a number of errors.
I’m trying to build a script to help me manage Finder labels (which the Finder itself shows as ‘tags’, but searching for ‘tags’ or ‘tag’ in Finder’s dictionary returns nothing, while searching for ‘label’ does), and I can’t even get the current tag on a file. What’s wrong with this?
use AppleScript version "2.4" -- Yosemite (10.10) or later use scripting additions tell application "Finder" set currentLabel to the name of the label of item "test.md" of home end tell
Which returns this error:
Finder got an error: Can’t get label of document file "test.md" of folder "dr" of folder "Users" of startup disk.