AutoHotkey Community

It is currently May 24th, 2012, 2:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: July 18th, 2005, 4:40 pm 
Offline

Joined: March 3rd, 2005, 5:43 am
Posts: 62
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:

Code:
;===== 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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], maraskan_user, RaptorX and 20 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group