Re: Time to figure out what is going on... (kludge)
Re: Time to figure out what is going on... (kludge)
- Subject: Re: Time to figure out what is going on... (kludge)
- From: Glenn Sugden <email@hidden>
- Date: Mon, 22 Aug 2005 00:37:37 -0700
Seems as though the menu item isn't being clicked until the
front window becomes active (it looks like the window becomes
inactive when the script is run from the script menu).
I've kludged it to keep trying the menu item until another
window appears (which will happen when you click on the front window
- the menu item will then be clicked and a New Viewer Window will
open...)
Any ideas what is going on? Would you file this as a bug?
::Glenn
-- open unread messages --
on run
try
tell application "Mail"
set viewer_count to (count of message viewers)
tell front message viewer to set unread_mailbox_list to
get selected mailboxes
if ((count of unread_mailbox_list) is 0) then
set unread_mailbox_list to (every mailbox whose
unread count > 0)
end if
set unread_mailbox_count to (count of unread_mailbox_list)
repeat with mailbox_index from 1 to unread_mailbox_count
set window_count to count windows
repeat while (window_count = (count windows)) --kludge
tell application "System Events"
tell process "Mail"
activate
click menu item "New Viewer Window" of
menu 1 of menu bar item "File" of menu bar 1
end tell
end tell
end repeat --kludge
set single_box_list to {item mailbox_index of
unread_mailbox_list}
tell message viewer (viewer_count + mailbox_index)
set the selected mailboxes to single_box_list
set the_messages to (every message whose read
status is false and deleted status is false)
set the visible messages to the_messages
set preview pane is visible to true
end tell
end repeat
end tell
on error error_message
display dialog error_message
end try
end run
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden