Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Safe Outlook Express Email Deleter


  • Please log in to reply
No replies to this topic
Larry
  • Members
  • 63 posts
  • Last active: Jan 05 2019 04:39 AM
  • Joined: 03 Mar 2005
One shortcoming of Outlook Express is that it's easy to accidently delete a mail folder if you're not paying close attenton. So I set out to write a Script that would prevent such an accident from happening. I'm using the following script with Windows XP Pro SP2 and Outlook Express v6.00.2900.2180:

;===== Beginning of Script =====
; *** Outlook Express Safe Message Deleter ***

~RAlt:: ; Double-Click Right Alt Key to Delete Email
if (A_PriorHotkey <> "~RAlt" or A_TimeSincePriorHotkey > 400)
{
	; Too much time between presses, so this isn't a double-press.
	KeyWait, RAlt
	return
}

DetectHiddenWindows, on
SetTitleMatchMode, 2
SetTitleMatchMode, Slow
SetKeyDelay,0
IfWinActive, Outlook Express
{
send,^q
sleep,99
send,^d
sleep,99
errorlevel=0
controlgettext, q,, Outlook Express, folder
If errorlevel=0
{
Loop, 9
{
SoundPlay, *-1
SoundBeep, 999,55
}
msgbox,. . . . . . . . . . . . . .      Y O U _  C A N _  N O T _ D E L E T E _ A _  F O L D E R   ! ! !       . . . . . . . . . . . . .
Send, n
}
controlgettext, q,, Outlook Express, permanently delete
If errorlevel=0
{
send, y
}
}
Done:
return
;===== End of Script =====
In addition to the script saving my mail folders from accidental deletion,
I also find it to be a more convenient method for deleting emails than
using the mouse.

One thing I would like to add to the script though is the ability to take Outlook Express offline before it deletes the email (to prevent the next automatically selected email from being able to download an image, thus verifying my email address as valid to a spammer). I haven't figured out an easy way to do this though. The Offline toggle in Outlook Express doesn't have a Keyboard Shortcut.

Perhaps other AutoHotkey users would find Offline and Online commands in AutoHotkey to be very useful additions to an already great scripting utility too.

If anyone has any additions or improvements they would care to make to the above script, feel free to contribute. I'm fairly new to AutoHotkey and still anxious to learn new things about it.

Regards,
Larry