Re: Tell Blocks Considered Harmful (was Re: open for access)
Re: Tell Blocks Considered Harmful (was Re: open for access)
- Subject: Re: Tell Blocks Considered Harmful (was Re: open for access)
- From: Rick Gordon <email@hidden>
- Date: Fri, 19 Dec 2008 04:09:21 -0800
So, Chris, then please confirm that the code in sample 1 below (with multiple commands sent to "me," but nested inside an application call) -- as the skeleton of something much more complex -- would avoid your potential issues as well as the version in sample 2. Thanks.
--SAMPLE 1
tell application "Finder.app"
--blah blah
--blah blah
tell me
set theDate to (do shell script "date")
display dialog "Hi, the date is " & theDate
end tell
--blah blah
--blah blah
end tell
--SAMPLE 2
tell application "Finder.app"
--blah blah
--blah blah
end tell
set theDate to (do shell script "date")
display dialog "Hi, the date is " & theDate
tell application "Finder.app"
--blah blah
--blah blah
end tell
------------------
On 12/19/08 at 2:59 AM -0800, Chris Page wrote in a message entitled
"Re: Tell Blocks Considered Harmful (was Re: open for access":
>Tell blocks are meant to be a convenient way to avoid putting 'tell ... to ...' on every line. But you should avoid putting commands inside them that aren't a part of that application's terminology. You should avoid putting commands inside a tell block if you wouldn't put a 'tell ... to ...' in front of that line.
--
___________________________________________________
RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________
WWW: http://www.shelterpub.com
_______________________________________________
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