Plan for program help

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tazzzan33
Posts: 16
Joined: 07 Dec 2017, 12:41

Plan for program help

18 Dec 2017, 15:25

Looking for the communities thoughts on how to go about my plan.

I am looking to create a tool to read from a SQL database down the road that pulls in shared hotstrings. This will allow me to maintain what is added to the teams hotstrings. I need help with the how to make the strings they select dynamic for each person. My current thoughts were to use the gui to turn on and off simple hotstrings such as below but am not sure if that is possible or if the gui should create a different AHK file with the strings for a user.

Code: Select all

::example::
Send, Print this test sentence
Return
Trying to think ahead on a plan. Any tips or wisdom is greatly appreciated.

Thank you.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Plan for program help

18 Dec 2017, 16:00

I'd been intending to do a dynamic hotstrings script for a while. Here's a way to do it, using the ExecScript function from the documentation:
Run / RunWait
https://autohotkey.com/docs/commands/Run.htm#ExecScript

Code: Select all

#Persistent
OnExit("ExitFunc")
vScript = ;continuation section
(
:*:a5-::abcde
:*:b5-::bcdef
:*:c5-::cdefg
)
ExecScript(vScript, 0)
DetectHiddenWindows, On
SetTitleMatchMode, 2
WinWait, \* ahk_class AutoHotkey
WinGet, hWndHg, ID, \* ahk_class AutoHotkey
return

;==================================================

;[ExecScript function]
;Run / RunWait
;https://autohotkey.com/docs/commands/Run.htm#ExecScript

ExecScript(Script, Wait:=true)
{
    shell := ComObjCreate("WScript.Shell")
    exec := shell.Exec("AutoHotkey.exe /ErrorStdOut *")
    exec.StdIn.Write(script)
    exec.StdIn.Close()
    if Wait
        return exec.StdOut.ReadAll()
}

;==================================================

ExitFunc()
{
	global hWndHg
	WinClose, % "ahk_id " hWndHg
}

;==================================================
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 338 guests