Does Applescript work?

Ken Norris (dialup) pixelbird at interisland.net
Mon Feb 4 15:31:01 EST 2002


on 2/3/02 6:27 PM, Sarah Reichelt at sarahr at genesearch.com.au wrote:

> Having struggled with AppleScript for many years, I have a few pieces of
> advice. 
> 
> Firstly, always write & debug in an AppleScript editor before transferring
> the script to HyperCard or Rev.
> 
> Secondly, do the bare minimum in AppleScript and do as much as you can in
> xTalk - it is faster to run and easier to program & debug.
> 
> With your list of processes, I used the following technique:
> 
> I copied this script into a field:
> tell application "Finder"
> return every process
> end tell
> 
> Then I had a button with this script:
> on mouseUp
> do fld "AppleScript1" as AppleScript
> -- now get what the AppleScript returned
> put the result into processList
> -- now do your stuff
> end mouseUp
> 
> 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.

Best regards,
Ken N.




More information about the Use-livecode mailing list