• 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
Re: Scripting Additions Calls in Tell Blocks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting Additions Calls in Tell Blocks


  • Subject: Re: Scripting Additions Calls in Tell Blocks
  • From: Graff <email@hidden>
  • Date: Mon, 09 Feb 2004 20:44:01 -0500

You can easily time scripts through the command line by combining the shell command "time" with the shell command "osascript". For example:

/usr/bin/time osascript -e 'open location "http://www.google.com/";'

or

/usr/bin/time osascript -e 'tell application "Safari"' -e 'open location "http://www.google.com/";' -e 'end tell'


You can also save your script as a text file and call it like this:

/usr/bin/time osascript ~/Desktop/tell.txt


It works well and you don't have to roll your own timer code which may or may not affect the measurements. Remember to explicitly call the command "/usr/bin/time" rather than just the shell built-in command "time". The version in "/usr/bin" has a more readable output format.

- Ken

On Feb 9, 2004, at 7:34 PM, Michael Terry wrote:

I used a timer which depended on the GetMilliSec osax, because I couldn't think of an easy way to illustrate the cases with plain AS.

Now, I happen to think 'open location''s behavior is wonderful, but what I'm claiming is, unless you specifically need a special effect, you should normally not execute addition commands in app tell blocks. Sometimes it doesn't make any difference, but sometimes it does.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Scripting Additions Calls in Tell Blocks
      • From: Christopher Stone <email@hidden>
References: 
 >Scripting Additions Calls in Tell Blocks (From: Michael Terry <email@hidden>)

  • Prev by Date: removing an alarm in Palm Desktop
  • Next by Date: Re: Scripting Additions Calls in Tell Blocks
  • Previous by thread: Re: Scripting Additions Calls in Tell Blocks
  • Next by thread: Re: Scripting Additions Calls in Tell Blocks
  • Index(es):
    • Date
    • Thread