On 23/06/2012, at 4:12 PM, Ronald Hofmann wrote:
by system default label colors are named like this:
- red
- orange
- yellow
- green
- blue
- violett
- grey
They aren't here -- it depends on the localization. And although they appear in that sort of order, it doesn't match their label index -- orange, for example, is label index 1, and red is 2. But color names can be changed by the user. So I´m trying to get the color names by looping thru label indices from 1 to 7. But whatever I try I always get errors.
This requires ASObjC Runner, and will give you the names in order {0, 7, 6, 5, 4, 3, 2, 1}:
script getLabelNames return current application's NSWorkspace's sharedWorkspace()'s fileLabels() end script tell application id "au.com.myriad-com.ASObjC-Runner" -- ASObjC Runner.app set theLabels to run the script {getLabelNames} with response end tell
--> {"None", "Gray", "Green", "Purple", "Blue", "Yellow", "Red", "Orange"}
|