Where to put Applescripts

Robert Brenstein rjb at robelko.com
Mon Feb 13 11:34:48 EST 2006


>Hello listeroos!
>
>I have another question: Where is the best place to 'put' 
>Applescripts in Revolution?
>I test them by putting them in a field and 'do' that field as applescript.
>
>I was thinking of using custom properties but some scripts need to 
>be built 'live' as in:
>put first part of script into variable
>then add Rev variable to that variable
>then put last part of script after that variable
>lastly, do variable as applescript
>
>Or would it be better to put the pieces in the stack as variables 
>(then they could be reused often)
>
>Thanks
>
>Tom

Your thinking is quite correct and there is no need to split them 
into parts. Just put the whole applescript into a custom property 
with tokens where the dynamic parts are; for example, [datafilepath] 
can be a token for a filepath. At runtime, fetch this property into a 
variable and replace the tokens with actual values.

By the way, have you tried talking directly to iTunes from Rev? Look 
up send to program command. The commands are what you tell in 
AppleScript to do.

Robert



More information about the use-livecode mailing list