• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
‘run script’ best practices (was Application Script Menus)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

‘run script’ best practices (was Application Script Menus)


  • Subject: ‘run script’ best practices (was Application Script Menus)
  • From: Chris Page <email@hidden>
  • Date: Sat, 20 Dec 2008 18:50:35 -0800

On Dec 20, 2008, at 5:35 AM, Nigel Garvey wrote:

Cross-process messaging time can be reduced quite a bit by delegating communications to 'run script':

 script
   tell application "Blah"
     -- Do several interesting things.
   end tell
 end script

 run script result

‘run script’ best practices:

1. Don't send ‘run script’ to another process unless the performance overhead is a serious impediment. Scripts aren't guaranteed to run correctly when sent to another process.

2. If you're using ‘run script’ with source text, explicitly indicate the script language with the ‘in’ parameter, otherwise the language used to compile will depend on the current default language inside the target process, which could change at any moment. Better yet, compile the script, save it in a file and use ‘run script’ to run the compiled script file instead.

run script v : Run a specified script or script file
run script script : the script text (or an alias or file reference to a script file) to run
[with parameters list of any] : a list of parameters
[in text] : the scripting component to use; default is the current scripting component
→ any : the result of running the script

-- 
Chris Page

 The other, other AppleScript Chris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: Application Script Menus (From: "Nigel Garvey" <email@hidden>)

  • Prev by Date: Re: HFS paths (was Tell Blocks Considered Harmful)
  • Next by Date: Re: A bit more UI capabilities? (was: Re : on blocking target applications' GUIs)
  • Previous by thread: Re: Application Script Menus
  • Next by thread: Re: libraries vs copy/paste
  • Index(es):
    • Date
    • Thread