How to use this AutoHotKey code.

Hello Experts, How could i use this Auto Hotkey code (ahk)

	pid := 0
	handle := getHandle(pid,name)
	if (handle = "") {
		return ; handle not found
	command := "C:\Users\Astryd\Risorse\_CircleDocks\handle.exe -p " . pid . " -c " . handle . " -y"
	Run, %comspec% /c %command%,, Hide

getHandle(ByRef pid,name) {
	command := "C:\Users\Astryd\Risorse\_CircleDocks\handle.exe -a " . name
	stdout := runStdout(command)
	needle := "No matching" ;when Handle found nothing return in standard output "No matching handles found."
	IfInString, stdout, %needle%
		return ""
	handle := RegExReplace(stdout, "s).*(...): \\Sessions\\1\\BaseNamedObjects\\_CircleDock_.*", "$1")
	pid := RegExReplace(stdout, "s).*pid: (\d*).*", "$1")
	Return handle

; Run a command and return standard output
runStdout(command) {
    shell := comobjcreate("")
    exec := (shell.exec(comspec " /c " command))
    stdout := exec.stdout.readall()   
    Return stdout

Open in new window

juvilux jetstudentAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Joe Winograd, Fellow&MVEDeveloperCommented:
How could i use this Auto Hotkey code (ahk)
The first step in using it is to download AutoHotkey to at least one computer. This EE article explains how to do that:
AutoHotkey - Getting Started

If you install AutoHotkey via its standard installer, it will own the AHK file extension. So you would take the code that you posted and put it in a plain text file with whatever text editor you prefer, even the built-in Notepad, and call it whatever you want, but make sure the file extension is AHK (not TXT). Then a double-click on the file in Windows/File Explorer, or whatever file manager you use, will run the AutoHotkey script. If you want to use it on a computer without AutoHotkey installed, compile it into a stand-alone EXE file with the AutoHotkey compiler that's on the computer where you installed AutoHotkey. The EXE file will run on systems without AutoHotkey installed. My article cited above also discusses how to use the compiler. Regards, Joe

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Joe Winograd, Fellow&MVEDeveloperCommented:
The question is how to use the posted AutoHotkey code. The selected comment explains exactly how to do that, including reference to an article published at Experts Exchange.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.