Re: Tex-Edit: what's wrong with this variable?
Re: Tex-Edit: what's wrong with this variable?
- Subject: Re: Tex-Edit: what's wrong with this variable?
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 15 Feb 2003 10:59:35 -0800
On 2/15/03 10:32 AM, "Gnarlodious" <email@hidden> wrote:
>
Can someone tell my why this won't work? Is there some "variable conversion"
>
trick I need to turn Tex-Edit's internal color "black" into the results of
>
the variable "backgroundColor"?
>
>
set backgroundColor to "black"
>
>
tell application "Tex-Edit"
>
activate
>
tell the front window
>
set background color to black -- this is OK
>
set background color to backgroundColor -- this is unOK
>
End tell
You've defined backgroundColor as "black", a string, outside a Tex-Edit
tell block. In fact it's an application constant black (no quotes, not a
string) - an enumeration - definable only within the tell block. It means
that if the user has chosen the string "black" in a choose from list, for
example, you'll have to translate it:
set backgroundColor to "black"
tell application "Tex-Edit"
if backgroundColor = "black" then
set backgroundColor to black
else if backgroundColor = "red" then
set backgroundColor to red
else
--etc
end if
activate
tell the front window
set background color to backgroundColor
end tell
end tell
You might be able to get away with a 'run script' avoiding a long 'else if'
chain (untested):
tell application "Tex-Edit"
set backgroundColor to (run script backgroundColor)
--etc.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.