Re: Eudora AppleScript Question...
Re: Eudora AppleScript Question...
- Subject: Re: Eudora AppleScript Question...
- From: Doug McNutt <email@hidden>
- Date: Sun, 26 Oct 2003 11:26:52 -0700
>
.... but that raises the question of how do I get a script to select the "next" message, when "next" is a concept that Eudora appears to keep outside the domain of AppleScript?
With two consecutive messages selected:
tell application "Eudora"
set storbx to a reference to mailbox "Trash"
set thismsg to a reference to message 1
set thismsgID to the id of message 1
move thismsg to end of storbx -- Moves the top message to the trash and deselects it
open message 1 -- Opens the second selected message in spite of the "1" !
open thismsg -- Does NOT open the original message but may be re opening message 2.
open message thismsgID -- Ignored. Does NOT open the original message 1
end tell
The conclusion is, as is everything AppleScript, that a whole lot of experimentation is required after which the dictionary may, or may not, make any sense.
"message 1" really means the "next selected message". After one moves a message - anywhere - it is no longer in the selected list.
And moving to the "end" of a mailbox is curious especially when it's the end of the mailbox it's already in. Stuff added to a mailbox is always at the end of the mailbox file in the sense of where it is on the hardware. The end you see is an illusion depending on the current sorting specifications. I doubt that Eudora actually moves anything on disk when move to the end of current mailbox is specified.
As an interesting sample this code is used to remove spam I see on my boss' mail when I read it before he does. I can select non-contiguous messages and run the script.
tell application "Eudora"
set storbx to a reference to mailbox "SPAM"
repeat
try
set status of message 1 to already read
on error
exit repeat -- Quit the loop when messages are gone
end try
set thismsg to a reference to message 1
if is on server of message 1 then
set will be deleted of message 1 to true
end if
move thismsg to end of storbx
end repeat
end tell
--
Applescript syntax is like English spelling:
Roughly, but not thoroughly, thought through.
_______________________________________________
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.