• 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: KOENIG Yvan <email@hidden>
  • Date: Sat, 23 Jun 2012 09:59:47 +0200

You may try this code :

--[SCRIPT]

set colors_loc to {}
(*
Grab the default localized colors names *)
repeat with i from 0 to 7
copy (my get_color_loc(i)) to end of colors_loc
end repeat
(*Aucun, Gris, Vert, Violet, Bleu, Jaune, Rouge, Orange*)

set thePlist to (path to preferences from user domain as text) & "com.apple.Labels.plist"
tell application "System Events"
tell contents of property list file thePlist
(*
Grab the custom color names *)
repeat with i from 1 to 7
try
value of property list item ("Label_Name_" & i)
set item (i + 1) of colors_loc to result
end try
end repeat
end tell
end tell
colors_loc
{"Aucun", "Gris", "VertVert", "VioletPurple", "Bleu", "Jaune", "Rouge", "Orange"}

--=====

on get_color_loc(num)
set path2res to "" & (path to library folder from system domain) & "Frameworks:ApplicationServices.framework:Versions:A:Frameworks:HIServices.framework:Versions:A:Resources:"
tell application "Finder" to return localized string ("Label_Name_" & num) from table "Labels" in bundle file path2res
end get_color_loc

--=====
--[/SCRIPT]

Yvan KOENIG (VALLAURIS, France) samedi 23 juin 2012 09:59:01



 _______________________________________________
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: Applescripts often going wrong when saved as package
  • Previous by thread: Re: color name for a label index
  • Next by thread: Re: color name for a label index
  • Index(es):
    • Date
    • Thread