Re: Mail.app selection of front window
Re: Mail.app selection of front window
- Subject: Re: Mail.app selection of front window
- From: Philippe GRUCHET <email@hidden>
- Date: Sat, 29 Mar 2003 02:06:11 +0100
From: Matthew Galaher <email@hidden>
Can any one offer an example of how to get a selection in Mail.app
into a variable?
There's no way to get a direct selection. We have to use "System
Events" to copy-paste.
(Mach-O 10.2.4 / System Events 1.2/ Smile 2.5.2)
==========================
tell app "Mail" to activate
tell app "System Events"
click application process "Mail"'s menu bar 1's menu 4's menu item 5
set x to the clipboard
-- clipboard info -- optional but useful
end tell
x --> your selection as a variable
==========================
Works fine from "ScriptMenu" too!
Note for advanced scripters:
In raw codes:
click application process "Mail"'s menu bar 1's menu 4's menu item 5
Becomes:
+event prcsclic; +class pcap; "Mail"'s +class mbar; 1's +class menE;
4's +class menI; 5
==========================
From: Andrew Oliver <email@hidden>
The fact remains that UI scripting is a poor hack that's too often
used to overcome poorly-implemented AppleScript dictionaries/support
in applications.
I agree, but just think to beginners: it would be so cool and didactic
to script GUI via a simple... R E C O R D command from within Apple's
SE, Smile and SD.
<sorrow> Hmm... record... ? </sorrow>
<mood> Does it even mean something on OSX...? </mood>
Kind regards,
Philippe Gruchet/SVM Mac
VNU Publications France
http://svmmac.vnunet.fr
_______________________________________________
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.