Here is the code for several scripts I have assigned to
some of my Toolbar For Any buttons, that I find useful.
Early versions that exist here could be broken by later
versions of AutoIt or Toolbar For Any, so please advise
me and I'll update (they may have slipped through). The
last few further down the page should be up-to-date if
I added them recently.

Also see the 'More Scripts' folder for other examples.


1. Character Checker
====================
Global $txt, $inifle

;$inifle = @ScriptDir & "\Settings.ini"
;$def = IniRead($inifle, "Title", "part", "")
;AutoItSetOption("WinTitleMatchMode", 2)
;WinActivate($def, "")
;Send("^c")
$txt = ClipGet()
MsgBox(0, "Character Checker", Asc($txt) & " = Asc." & Chr(13) & Chr(Asc($txt)) & " = Chr.")


2. Count the number of selected characters
==========================================
Global $cnt, $inifle

$inifle = @ScriptDir & "\Settings.ini"
$def = IniRead($inifle, "Title", "part", "")
AutoItSetOption("WinTitleMatchMode", 2)
WinActivate($def, "")
Send("^c")
$cnt = ClipGet()
$cnt = StringLen($cnt)
MsgBox(0, "Character Count", $cnt & " copied to clipboard!") 
ClipPut($cnt)


3. Find & Clear the Next bookmark
=================================
Global $def, $inifle
$inifle = @ScriptDir & "\Settings.ini"
$def = IniRead($inifle, "Title", "part", "")
AutoItSetOption("WinTitleMatchMode", 2)
WinActivate($def, "")
Send("{F2}")
Send("^{F2}")


4. View an include file!
========================
Global $au3, $aut, $cnt, $incl, $inifle, $len, $prog, $pth, $regky

$inifle = @ScriptDir & "\Settings.ini"

$prog = IniRead($inifle, "Program", "path", "")
If StringInStr($prog, "\SciTe.exe") < 1 Then Exit

$regky = "HKEY_CLASSES_ROOT\AutoIt3Script\Shell\Run\Command"
$aut = RegRead($regky, "")
;MsgBox(0, "$aut", $aut)
If $aut = "" Then Exit

$def = IniRead($inifle, "Title", "part", "")
AutoItSetOption("WinTitleMatchMode", 2)
WinActivate($def, "")
Send("^c")
$au3 = ClipGet()
;MsgBox(0, "$au3", $au3)

If StringRight($au3, 4) = ".au3" Then
	$pth = StringSplit($aut, "\")
	;MsgBox(0, "$pth[0]", $pth[0])
	$len = StringLen($pth[$pth[0]])
	;MsgBox(0, "$len", $len)
	$incl = StringTrimRight($aut, $len)
	$incl = $incl & "Include\"
	$incl = $incl & $au3
	;MsgBox(0, "$incl", $incl)
	If FileExists($incl) Then
		;MsgBox(0, "Exists", $incl)
		Run('"' & $prog & '" "' & $incl & '"')
	EndIf
EndIf


5. Find a highlighted variable at the top of the page!
======================================================
I use this to see if I have assigned a Global variable.
All my Global variables are declared near the top of a page.
To use this properly, you must highlight the variable before
clicking the assigned button. That variable is copied, and a
bookmark is toggled, the find dialog is opened, cursor jumps
to top of page, enter is clicked to start search and close
the find dialog (obviously your previous search options will
impact on how well this works or if at all). If you haven't
declared the variable, then most likely you will be returned
to where you started or to another instance in your code. In
the scenario where it isn't declared, I use my go to top of
page button (see SendKey example), then because the variable
is already on the clipboard, I just paste it at the relevant
declaration section. Finally regardless of the find result,
I then use the NEXT bookmark button (see Sendkey example) to
return to where I started (more than one click if you have
any other bookmarks between), where I then toggle off that
bookmark using my TOGGLE bookmark button (see Sendkey), and
then either continue with my work or move on to checking the
next variable.

WinActivate("SciTE", "")
Send("^c")
Send("^{F2}")
Send("^{PGDN}")
Send("^f")
Send("^{HOME}")
Send("{ENTER}")
