Re: Tell Blocks Considered Harmful
Re: Tell Blocks Considered Harmful
- Subject: Re: Tell Blocks Considered Harmful
- From: Ed Stockly <email@hidden>
- Date: Fri, 19 Dec 2008 18:20:26 -0800
... and makes it clear to anyone reading the code that you don't
intend it to use Finder's terminology for those lines.
You know I think it's this whole thing about intent that's driving
this thread.
tell Application "Finder"
tell folder 1
set x to 10* (the number of items)
end tell
end tell
Do I want the folder to do addition? No. Do I want the Finder to do
the math? No. But that command is being sent to that folder in the
finder. But clearly my "intent" is to perform math on a number that is
derived from the folder. Multiplication is performed by appleScript,
not the finders.
Should I have taken the math out of the tell block to clarify my intent?
Since Finder doesn't understand that command it's passed up the
hierarchy to appleScript. From my point of view that's no different
than putting an OSAX call inside a Finder tell.
OSAX are language additions. They add commands to the language.
ES
_______________________________________________
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