set blueGray to {"8000", "8000", "10000"}
set black to {"0", "0", "0"}
set white to {"65535", "65535", "65535"}
set red to {"65535", "0", "0"}
set manual to "Choose Color"
set theColorList to {"Black", "blueGray", "White", "Red", "Manual"}
set theChoice to choose from list theColorList default items "blueGray" with title "Color Selection"
(* the result is a list or the boolean « false » *)
if theChoice is false then error number -128 (* Exit silently *)
set theChoice to item 1 of theChoice
(* Here, theChoice is a string *)
display dialog theChoice
(* This if-then-else block will define the color value *)
if theChoice = "Manual" then
choose color
(* Here the result is a RGB color *)
set theColor to result
else if theChoice = "bluegray" then
set theColor to blueGray
else if theChoice = "Black" then
set theColor to black
else if theChoice = "White" then
set theColor to white
else if theChoice = "Red" then
set theColor to red
else
set theColor to blueGray -- default
end if
tell application "GraphicConverter"
activate
set background color to theColor
end tell
Yvan KOENIG (VALLAURIS, France) samedi 26 mai 2012 19:22:29