Scripting Mail (After some Progress)
Scripting Mail (After some Progress)
- Subject: Scripting Mail (After some Progress)
- From: Marcus Rodrigues <email@hidden>
- Date: Tue, 27 May 2003 18:38:58 -0300
I had succes in making Mail select the Unread Messages.
Now, using the GUI, I could make it open the print dialog, but the
final thing (clicking the Print button), I can't....
I tried many ways of doing this... none worked.
Please, expert guys, look at i and show where i am failing.
It's the last part of my long script and think the rest will be easy to
complete. Just this button and I'm done.
if my do_menu("Mail", "File", "Print...") is false then error number
-128
if my do_menu("Mail", "File", "Print...") is false then error number
-128
on do_menu("Mail", "File", "Print...")
try
-- bring the target application to the front
tell application "Mail"
activate
end tell
tell application "System Events"
with timeout of 300 seconds -- 5 minutes
tell process "Mail"
tell menu bar 1
click menu item "Print..." of menu "File" -- opens the print
dialog
end tell
end tell
end timeout
tell window "Print"
with timeout of 300 seconds
click button "Print" -- should print, but does not . I tried
(click button "Print" of window "Print") too...
end timeout
end tell
end tell
return true
on error error_message
return false
end try
end do_menu
Here is the UI description of the Print button:
<AXApplication: bMailb>
<AXWindow: bPrintb>
<AXUnknown>
<AXUnknown>
<AXButton: bPrintb>
Attributes:
AXRole: bAXButtonb
AXRoleDescription: bAXButtonb
AXChildren: b<array of size 0>b
AXParent: b<AXUnknown>b
AXTitle: bPrintb
AXWindow: b<AXWindow: bPrintb>b
AXPosition: bx=584 y=288b
AXSize: bw=70 h=20b
AXEnabled: b1b
Actions:
AXPress - press
o#? Marcus Rodrigues o#?
iBook 600 - Combo - Jaguar
CC4nsul do Brasil Apple Clube - Caxias do Sul
ichat: marcusrodrigues
mailto:email@hidden
http://homepage.mac.com/marcusrodrigues
_______________________________________________
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.