I'm not sure if this script warrants posting anywhere, but it's useful for me, so maybe it'll be of use to someone else.
The idea is just to have a quick way to review notes, for example, I recently adopted one of the mouse gesture scripts, so I want to be able to see the gestures flash up on my screen with a press of a button.
Hotkey: ~Esc - pressed down for 0.6 sec, does not prevent it's other uses. After 0.6s it activates the accent (`) key to flip though notes. Releasing Esc deactivates the script.
Note: I chose the accent (`) key because it's right under Esc on my keyboard. I also used its SC value, which may vary from computer to computer, so anyone using this should just change it to whatever is convenient for them.
Requires a "QuickNotes" folder in script's directory (default) with notes (.txt files, etc.) in it to display quickly:
update: uses F1 now instead of ``
Code:
#NoEnv
#SingleInstance force
SendMode, Input
CoordMode, ToolTip, Screen
SetWorkingDir, %A_ScriptDir%\QuickNotes
~Esc::
KeyWait, Esc, T0.6 ;press Esc down for 0.6 sec to activate quick-notes, F1 to flip thru them
if errorlevel
{
note:=1
loop, *.*
index.= A_LoopFileName . "`n"
ToolTip, %index%, %A_ScreenWidth%, 0
Hotkey, F1, readQuickNotes, On
KeyWait, Esc
ToolTip
Hotkey, F1, readQuickNotes, Off
loop, % index0
index%A_Index%:=
note:=0, content= index= index0= target=
}
Return
readQuickNotes:
StringSplit,index,index,`n
FileRead, content, % target:= index%note%
note:= note < index0 ? note+1 : 1
ToolTip, %content%, %A_ScreenWidth%, 0
Return
Question 1: Is there a command or an easy way to clear all variables at the end of a script?
Question 2: I wanted to use F1 as the temporary hotkey instead of accent (`), but help windows from other apps kept popping up. I couldn't figure out how to temporarily (while Esc down) block F1 output outside of the script?
To add: Change accent (`) hotkey to F1 (more ergonomic), and extend quick notes to jpgs (i'm think SplashScreens to display image notes e.g. screenshots in jpg...).
edit: added SendMode, Input and On after first Hotkey command.