I am new to this board but I made a script I would like to share. It's an onscreen highlighter with 6 color options and variable transparency, using F1 to F6 plus mouse click.
Obviously, it is impossible to add highlights to an actual file, so this is not about highlighting a document for reading later, but rather, highlighting "on the fly" while you are reading a difficult section of text.
It's ideal for students, proofreaders, translators - anyone who reads difficult texts frequently. It's also nice stress relief just to make patterns on your screen
Hold down an F key (F1 to F6) then click once for the start point of the highlight, move the mouse then click a second time for the end point. You can go left to right or right to left.
Escape clears the highlights
Would welcome any comments,
Code: Select all
#NoEnv
#SingleInstance, force ; edited - thank you DataLife
SetWorkingDir %A_ScriptDir%
CoordMode, Mouse, Screen
global t := true
global startxpos
global startypos
F1 & Lbutton::
drawhighlight("fff100", 75) ;yellow
return
F2 & Lbutton::
drawhighlight("ff8c00", 75) ;orange
return
F3 & Lbutton::
drawhighlight("e81123", 75) ;pink
return
F4 & Lbutton::
drawhighlight("00bcf2", 75) ;cyan
return
F5 & Lbutton::
drawhighlight("68217a", 75) ;purple
return
F6 & Lbutton::
drawhighlight("009e49", 75) ;green
return
drawhighlight(color, trans){
if t{
MouseGetPos, startxpos, startypos
boxy:=startypos-10
Gui, New
Gui, +LastFound +AlwaysOnTop +Owner
WinSet, Transparent, %trans%
Gui, +LastFound -Caption
Gui, Color, %color%
Gui, Show, W10 H20 X%startxpos% Y%boxy%
t := !t
}
else{
MouseGetPos, endxpos, endypos
boxy:=startypos-10
if (endxpos > startxpos){
boxx:=startxpos+10
boxw:=(boxw:=endxpos-startxpos-10)
}
if (endxpos < startxpos){
boxx:=endxpos
boxw:=(startxpos-endxpos)
}
if (endxpos = startxpos){
boxx:=startxpos+10
boxw:=10
}
Gui, New
Gui, +LastFound +AlwaysOnTop +Owner
WinSet, Transparent, %trans% ;Set the transparency
Gui, +LastFound -Caption
Gui, Color, %color%
Gui, Show, W%boxw% H20 X%boxx% Y%boxy%
t := !t
}
return
}
~Esc::reload