thanks in advance for any help.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
ToDoFile = todo.txt
Priority = (A)
Project = +Inbox
F7::
olApp := ComObjActive("Outlook.Application")
Subject := olApp.ActiveInspector.CurrentItem.Subject
If Subject =
{
GoTo, Blank
}
else
{
PSubject := RegExReplace(Subject,"^(?:RE|FW): ")
PSubject := StrReplace(PSubject, "+", "_")
FileRead, TDFile, %ToDoFile%
FileDelete, %ToDoFile%
sleep, 100
FileAppend, %Priority% %PSubject% %Project% file:///%PSubject%.msg`r`n%TDFile%, %ToDoFile%
}
return
Blank:
Gui, 3:+AlwaysOnTop +ToolWindow -SysMenu -Caption
Gui, 3:Color, ffffff ;changes background color
Gui, 3:Font, cFF0000 s20 wbold, Verdana ;changes font color, size and font
Gui, 3:Add, Text, x0 y0, Open an email for this! ;the text to display
Gui, 3:Show, NoActivate, Xn: 0, Yn: 0
sleep, 1000
Gui, 3:Destroy
return