Re: Scripting Additions Calls in Tell Blocks
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.