Re: Selecting messages in Outlook Express
Re: Selecting messages in Outlook Express
- Subject: Re: Selecting messages in Outlook Express
- From: Philippe GRUCHET <email@hidden>
- Date: Thu, 6 Mar 2003 08:12:24 +0100
An old script [no break] for OE to use as example.
(Tested with Outlook Express 4.5 under Mac OS 9.2.2.)
First put this script inside the Outlook Express script folder. Launch
this script from within the Outlook Express script menu to directly
move all HTML message(s) from the Inbox to the Trash folders.
-- sos
set string1 to "new unread HTML message" as string --> will be used in
dialogs
set string2 to "in your Inbox folder." as string --> ditto
set string3 to "Do you want to delete" as string --> ditto
set string4 to "been moved to the deleted mail folder." as string -->
ditto
set the_list to {"No", "", "s", "this message?", "those messages?",
"ha", "ve"} --> ditto
--
(* A 'counter' is very useful to count any kind of result, as integer:
*)
set counter to 0 as integer
--
tell application "Outlook Express"
if (number of folder is greater than 0) then (get name of folder 1)
if (in box folder is folder 1) then set ibf to (in box folder)
--open ibf --> optional. Means: open the 'in box folder' in a separate
window
set x to (number of messages in ibf) --> number of incoming/outgoing
messages inside "in box folder" (ibf)
if x is greater than 0 then
(* This Repeat (or loop) statement counts the number of unread HTML
message(s) : *)
repeat with i from 1 to x
set y to (message i of ibf)
if read status of y is untouched then --> means: not read yet
if has html in y then --> means: the content of message is in HTML
format
copy counter + 1 to counter --> here, the counter will get all
conditional results by step of +1, as integer
end if
end if
end repeat
set z to (counter as integer) --> means: z is equal to number of
unread HTML message(s) found in 'ibf '
if z = 0 then
copy ((item 1 of the_list) & space & string1 & space & string2) to
the_report1
display dialog the_report1 buttons "Quit" default button 1 with icon
1 giving up after 20 --> 'giving up' is useful to auto-cancel (dismiss)
the displayed dialog
return
end if
end if
if z = 1 then set the_var1 to (item 2 of the_list)
if z > 1 then set the_var1 to (item 3 of the_list)
if z = 1 then set the_var2 to (item 4 of the_list)
if z > 1 then set the_var2 to (item 5 of the_list)
copy ((item 2 of the_list) & z & space & string1 & the_var1 & space &
string2 & return & return & string3 & space & the_var2) to the_report2
-- beep z --> render number of beeps (through default system alert
sound) of unread HTML message(s) found in "ibf '. Very optional, just
for fun :)
display dialog the_report2 with icon 2 giving up after 60
if button returned of result is "Ok" then --> click Ok button or press
Enter/Return keys has same effect =>
try
repeat
repeat with i from 1 to x
set y to (message i of ibf)
if read status of y is untouched then
if has html in y then
if false is result then exit repeat
if true then move y to deleted mail folder --> means: move each
html message(s) to deleted mail folder (trash)
exit repeat
end if
end if
end repeat
end repeat
on error
if z = 1 then set the_var2 to (item 3 of the_list)
if z > 1 then set the_var2 to (item 7 of the_list)
copy ((item 2 of the_list) & z & space & string1 & the_var1 & space
& (item 6 of the_list) & the_var2 & space & string4) to the_report3
display dialog the_report3 buttons "Quit" default button 1 with icon
1 giving up after 20
return --> an error can occur on the last message of the Inbox
folder, regardless of its status and format. Return means 'quit this
script '
end try
end if
end tell
-- eos
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.