• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: color name for a label index
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: color name for a label index


  • Subject: Re: color name for a label index
  • From: Shane Stanley <email@hidden>
  • Date: Sat, 23 Jun 2012 16:50:13 +1000

On 23/06/2012, at 4:12 PM, Ronald Hofmann wrote:

by system default label colors are named like this:
  1. red
  2. orange
  3. yellow
  4. green
  5. blue
  6. violett
  7. 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"}

-- 
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >color name for a label index (From: Ronald Hofmann <email@hidden>)

  • Prev by Date: Re: color name for a label index
  • Next by Date: Re: color name for a label index
  • Previous by thread: Re: color name for a label index
  • Next by thread: Re: color name for a label index
  • Index(es):
    • Date
    • Thread