Re: Mail.app selection of front window
Re: Mail.app selection of front window
- Subject: Re: Mail.app selection of front window
- From: Andrew Oliver <email@hidden>
- Date: Fri, 28 Mar 2003 12:52:16 -0800
Cricket,
I did try using standard AppleScript commands before I "spammed several
hundred people" with my post.
Maybe I missed something, but I couldn't find any way using 'pure'
AppleScript (not UI scripting) to get the selected text in a message.
In fact, you yourself confirmed there's no way to get the selected text, and
therefore I was right.
In my opinion, having to resort to UI scripting to select a menu item to
place text on the clipboard is a very poor substitute for a 'get selection'
command that works as the user expects. In general, I HATE manipulating the
clipboard in ANY script since it's potentially intrusive to the user.
The fact remains that UI scripting is a poor hack that's too often used to
overcome poorly-implemented AppleScript dictionaries/support in
applications.
Not being a Cocoa developer, I don't know whether the fault lies in Cocoa
(and therefore Apple), or in the developers themselves, just that it
frustrates me when I see cumbersome workarounds to what should be
straightforward actions.
And I absolutely refuse to believe there's no way the Mail.app developer
team couldn't have implemented *some* way of getting the selected text in
the front window as an AppleScript object. That's just not a credible answer
and proposing that just insults the intelligence of every person on this
list.
Mac OS X has been public for 2 years now and it's about time that Apple got
their act together with regards to AppleScript, both in the core system and
in its own applications. AppleScript is touted as a significant USP that's
often profiled in Mac OS success stories, yet limitations like the one that
prompted this thread just make it look like a joke once people dig a little
below the glossy finish.
Maybe my posts do seem confrontational (heck, maybe they ARE confrontational
;) ), but please don't get me wrong. I love Apple, and AppleScript, I just
don't accept that incomplete dictionaries and half-assed implementations of
kludges are an acceptable way of moving the platform forwards. Blindly
accepting what comes out of Cupertino doesn't help anyone in the long run,
and if my posts make one person at Apple think for a minute, then I'm happy
(of course, I'd be happier if that person could do something about it... ;)
)
Andrew
:)
On 3/28/03 12:20 PM, "cricket" <email@hidden> wrote:
>
>
On Friday, March 28, 2003, at 10:57 AM, Andrew Oliver wrote:
>
>
> Consequently, the only way I can see to get around this is to use the
>
> clipboard, oh... except that Mail doesn't support any standard
>
> clipboard
>
> commands which means, yet again, you'd have to resort to UI Scripting
>
> <urgh>
>
>
Clipboard commands are in Standard Additions and always have been.
>
Please at least look at dictionaries or try to use commands before
>
spamming several hundred people with poorly researched information.
>
>
You are correct that there is no way to get the selection in Cocoa
>
applications, other than using UI scripting, which in this case, is
>
fairly straightforward:
>
>
-- make sure window with selection is frontmost first
>
tell application "System Events"
>
tell application process "Mail"
>
click menu item "Copy" of menu "Edit" of menu bar 1
>
end tell
>
end tell
>
>
- cricket
>
>
----->
>
Software Entomologist - Mail for Mac OS X
>
http://www.apple.com/macosx/jaguar/mail.html
>
---------->
>
Eating the Initiative's technicolor food of strongness.
_______________________________________________
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.