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 15:33:23 -0700
On Dec 7, 2004, at 3:03 PM, Joseph Weaks wrote:
Not meaningless, just unclear. I am pretty sure what the OP is asking
is the kind of query you might make on, say, the selection. Or, say,
the result of
set theReference to some word of some document
and then get the containment hierarchy from there, the result would be
something like word 12 of document 2 etc.
Of course, the answer is basically 'no'. At least, not across
applications.
OK. I think I understand it.
tell application "TextEdit"
the selection
end tell
This returns an error because cocoa applications can't have text
selections. This worked:
tell application "TextEdit"
tell document 1
its text
end tell
end tell
I got the entire text of the document, but there was no way to get the
selection.
I tried it with BBEdit, and got this result
tell application "BBEdit 6.5"
the selection
end tell
insertion point before character 7 of text window 1 of application
"BBEdit 6.5"
Or, with text selected, I got this:
characters 9 thru 13 of text window 1 of application "BBEdit 6.5"
"contents of the selection" instead of "the selection" returned the
selected text.
But there was no way to get that it was the third word (which it
actually was) of the document, nor which paragraph, etc.
Also, the selection is always in Window 1, at least in this version of
BBEdit.
--
I am Dyslexic of Borg. Fusistance is retile. Your ass will be laminated.
_______________________________________________
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