Mail Scripting
Mail Scripting
- Subject: Mail Scripting
- From: Marcus Rodrigues <email@hidden>
- Date: Thu, 24 Jul 2003 15:22:40 -0300
Hi friends!!!
I'm still working on my Mail scriptind, ad I am having the following
dificulties:
First, the purpose of the script (for now):
Select unread messages, an print them at the default printer.
I managed to do both parts, but coudn't put the "print" part (made via
GUI scripting) inside the "select unread messages repeat loop". Can
anyone help me out?
Here is the script (it is very simple and probably buggy, but I am no
professional scripter =-):
-- the Select Part:
tell application "Mail"
activate
set lista to every message of mailbox "In" of account "Marcus" whose
the is read is false
set aMessage to every item in lista
-- Select messages
repeat with aMessage in lista
set selected messages of message viewer 1 to {aMessage}
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
end repeat
end tell
-- The Print part:
on do_menu("Mail", "File", "Print...")
try
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"
tell window "Print"
tell application "System Events" to keystroke (ASCII character
13)
end tell
end tell
end tell
end timeout
end tell
return true
on error error_message
return false
end try
end do_menu
Can anyone put them togheter??? Thx!!!!!
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.