Re: Mail.app selection of front window
Re: Mail.app selection of front window
- Subject: Re: Mail.app selection of front window
- From: John Delacour <email@hidden>
- Date: Mon, 31 Mar 2003 23:34:14 +0100
- Mac-eudora-version: 6.0a13
At 12:20 pm -0800 28/3/03, cricket wrote:
You are correct that there is no way to get the selection in Cocoa
applications, other than using UI scripting...
That is not true, and it is not the first time you have stated this
falsehood. It is possible to get the selection in a cocoa
application, as anyone can test by first compiling this script in
Script Editor 2, then selecting the word "the" and running the script
to get the result shown:
get the selection
--> characters 5 thru 7 of document 1
You now have the opportunity to educate us all by explaining
precisely why it is impossible to convert this selection object into
anything useful, whereas there is not problem with the script
characters 5 thru 7 of document 1 as text
--> "act"
You can also explain why it is impossible to get a real result from
the following and tell us exactly what the meaning of the error is,
as I'm sure we're all dying to hear the meaning of these arcane
hieroglyphics from one of the high priests.
set s to (the selection)
--> characters 11 thru 13 of document 1
class of s
--> "NSReceiverEvaluationScriptError: 5"
Then you can use this script as an example of what is actually
missing and explain to us the why and the wherefore and how very easy
it will be for the Applescript team to remedy the oversight in the
next system update.
set the clipboard to (get the selection)
the clipboard
--> characters 9 thru 17 of document 1
(the clipboard) = characters 9 thru 17 of document 1
--> false
_______________________________________________
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.