• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unwinding the containment hierarchy of a reference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Unwinding the containment hierarchy of a reference (From: "Scott Babcock" <email@hidden>)

  • Prev by Date: Re: [OT] Re: Smile and FruitMenu
  • Next by Date: RE: Unwinding the containment hierarchy of a reference
  • Previous by thread: Unwinding the containment hierarchy of a reference
  • Next by thread: Re: Unwinding the containment hierarchy of a reference
  • Index(es):
    • Date
    • Thread