Where to put Applescripts

Robert Brenstein rjb at robelko.com
Mon Feb 13 13:25:22 EST 2006


>Robert,
>
>The idea of using tokens is new to me. The idea seems sound but I am 
>confused about the syntax. Would you mind giving an example?
>My questions are how to extract the token and replace it? can I use 
>replace, find, etc.
>I looked up the token command and this was not clear.
>
>Thanks,
>
>Tom

I wanted to add that if you plan to edit those script on more or less 
regular basis, then keeping them in an normally invisible field is 
just as good as a property.

With regards to tokens, here is an example of an AppleScript:

tell application [appname] to activate

Let's assume you store it in a property called 
myApplescriptBringForward and you want to execute it to make Finder 
come forwards

put quote & "Finder" & quote into appname
get the myApplescriptBringForward of this stack
replace "[appname]" with appname in it
do it as applescript

I coded this quite explicitely and hope this makes things clear for you :)

Note that my using square brackets is not mandatory but they are 
convenient delimiters ensuring that the token is a unique string.

Robert



More information about the use-livecode mailing list