Re: Unwinding the containment hierarchy of a reference
Re: Unwinding the containment hierarchy of a reference
- Subject: Re: Unwinding the containment hierarchy of a reference
- From: Michelle Steiner <email@hidden>
- Date: Tue, 7 Dec 2004 14:07:00 -0700
On Dec 7, 2004, at 1:44 PM, Scott Babcock wrote:
Given an arbitrary AppleScript object reference, is there a reasonable
way to determine the object's containment hierarchy? For example:
tell application "TextEdit"
set x to a reference to word 12 of document 2
end tell
Is there a programmatic way to determine that word 12 is contained by
document 2, which is contained by application "TextEdit"?
I don't understand what you mean. Are you asking if there is a way to
tell whether there is a document 2, and if there is a document 2, is
there a word 12? If that's what you're asking, here is one solution.
tell application "TextEdit"
if document 2 exists then
tell document 2
if word 12 exists then
display dialog (word 12 as text)
else
display dialog "Word 12 of document 2 does not exist."
end if
end tell
else
display dialog "Document 2 doesn't exist"
end if
end tell
--
We're surrounded. That simplifies the problem.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden