• 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 12:06:23 +0200

Did you ran my complete script ?

The get_color_loc(num) handler return the default localized strings, not the possible customized ones.
My complete script replace the default values by the customized ones (when they exist).

Yvan KOENIG (VALLAURIS, France) samedi 23 juin 2012 12:06:06

Le 23 juin 2012 à 10:48, Ronald Hofmann a écrit :

> Hi Yvan,
> This did the trick:
> 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
>
> ==================
>
> Am 23.06.2012 um 09:59:47 schrieb KOENIG Yvan <email@hidden>:
>
>> 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]



 _______________________________________________
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>)
 >Re: color name for a label index (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: Applescripts often going wrong when saved as package
  • 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