Re: Damn send button / Wind chill
Re: Damn send button / Wind chill
- Subject: Re: Damn send button / Wind chill
- From: David Lloyd <email@hidden>
- Date: Tue, 05 Mar 2002 01:01:28 +1100
>
That suggests *strongly* to me that AS is not passing anything to the outer
>
app in any circumstances.
I touched on this recently, and to expand on my previous post:
(Apologies for this semi-repeat)...
(Note I currently have GTQ Sort osax installed)
This script runs:
copy (choose folder) to theFolder
set theItems to list folder theFolder
sort theItems
...while this script fails:
copy (choose folder) to theFolder
set theItems to list folder theFolder
tell application "Finder"
sort theItems
end tell
It fails because 'sort' is both an osax and a Finder word.
..now if I take my above example, and dare to nest application tells:
copy (choose folder) to theFolder
set theItems to list folder theFolder
tell application "Finder"
tell application "QuarkXPress 4.11"
sort theItems
end tell
end tell
...well now, this script runs OK.
This suggests that tell application nesting shelters the script within from
any terminology outside of it. QuarkXPress is suitable in this case, because
it in itself does not offer a 'sort' word.
Therefore I wonder if it *that* wrong to incorporate such nesting?
Perhaps it's more a good thing in some cases rather than otherwise?
While scripting Facespan, I found it essential in some cases to do such
application nesting, even incorporate a 'false nesting' to shelter my script
from some of Facespan's own terminology.
Another real live case was finding an offset in a string while buried in
QuarkXPress - this would fail, because QuarkXPress owns an "offset" word as
well:
tell document 1 of application "QuarkXPress 4.11"
set theOffset to offset of "text" in "this text"
end tell
Rather than get out of XPress's app tell, do get the offset bit, and then go
back in again, I found it convenient to stick in a Finder tell:
tell document 1 of application "QuarkXPress 4.11"
tell application "Finder"
set theOffset to offset of "text" in "this text"
end tell
end tell
-----
Much discussion has been around whether nesting application tells is good or
bad. It seems from what I've seen on this list lately the best advice might
be to recommend against such nesting, but if you have to, don't be afraid
to.
Best regards,
David Lloyd
---------------------------------
email: email@hidden
web:
http://www.kanzu.com
---------------------------------
_______________________________________________
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.