I posted this in the general developers forum a couple of days ago, but haven't got any resposes yet and as this forum now officially includes Applescript then here goes:
To 'introduce' myself to the Applescript language, I am writing a script that will create a web page based on answers to questions asked by the script.
In setting the background color, I would like the user to be able to select a color from a list presented to them.
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier><font color = green>if</font> the button_pressed is <font color = red>"Colour picker"</font> then choose from list {<font color = red>"Red"</font>, <font color = red>"Green"</font>, <font color = red>"Blue"</font>, <font color = red>"Orange"</font>, <font color = red>"Yellow"</font>}
with prompt <font color = red>"Choose a colour:"</font> <font color = green>default</font> items {<font color = red>"Red"</font>}</font>[/code]
As shown above, displaying the list of color options is not a problem. However, once the user clicks on 'OK', they will be returned to a dialog box, defined by the following:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>display dialog <font color = red>"Enter a background colour (as a hexadecimal value):"</font>
<font color = green>default</font> answer <font color = red>"FFFFFF"</font> buttons {<font color = red>"Cancel"</font>, <font color = red>"Colour picker"</font>, <font color = red>"OK"</font>}</font>[/code]
My problem is copying the answer selected in the list into this dialog box so that the user can see that their choice has been recognised. A further problem is converting the items in the list into hexadecimal RGB values to display in the dialog box.
For example, in the first dialogue box, the user will be asked to enter a color value or pick from a list. Once the user has selected a colour from the list, I would like the script to display the color's equivalent hexadecimal RGB value in the original dialogue box. My questions are:
* How do I place the value returned from a list (the "choose from list" command) into another dialogue box?
* If the values displayed in the list are normal words, how do I get them to display their hexadecimal RGB values in the dialog box?
Thanks in advance for your help!
