Does Applescript work?

Sarah Reichelt sarahr at genesearch.com.au
Mon Feb 4 18:18:01 EST 2002


In HyperCard, you could set the language of a particular script to
AppleScript. In Rev, you don't have this option so the AppleScript has to be
stored somewhere else or assembled and then used with a "do as AppleScript".

Edit the script in an AppleScript editor first and then copy it into a field
or property (I like Jeanne's suggestion - I keep forgetting to use
properties). All I am saying is that it is better not to try something like:

    put "tell application " & quote & "Finder" & quote & return in theScript
    put "return the processes" & return after theScript
    put "end tell" & return after newScript
    do theScript as AppleScript

This works for a short script but makes debugging very hard. It's much
easier if you can see the final script at any stage.

Sarah

>> I prefer to use a field rather than assembling the script in a Rev script
>> because it is much easier to catch any errors and to edit later. You can
>> hide the field once you have it working properly. If there is any chance of
>> the AppleScript failing, use a "try" construct and return the error to your
>> Rev script.
> ----------
> Seems like the way to go EXCEPT for one thing...
> 
> Why do you say it would be easier to edit a field than a script in the
> script editor? I know people that do this, of course, and you're obviously
> one of its fans, but I've never found it easier. I use fields to STORE
> scripts all the time, because of searchability, but I aways copy and paste
> ones what I'll actually use into object scripts.




More information about the use-livecode mailing list