Multiple Dynamic HotKeys in a single ahk file
Posted: 12 Dec 2017, 00:32
First of all, I have looked a lot of post that talks about putting multiple hotkeys in a single ahk file but i didn't find concrete answer to my questions.
I am trying to automate series of tasks in/on a single instance of IE for intranet application. Flow looks something like below :-
1) Login to Twitter. Lets call this individual script as 1_login.ahk.
2) Compose a tweet. 2_compose.ahk
3) Search for keyword. 3_search_keyword_tweet.ahk
4) Retweet and like. 4_rt_like.ahk
In this example, I would like to have a functionality where each user can assign their own hotkeys. For Example, I may use Control + A to execute step#1(1_login.ahk) to login but other person might prefer Control + B to execute same script (i.e. 1_login.ahk). My intention is to build a small gui that lets them pick hotkey and select a file from their drive that they want autohotkeys assigned to. I have a master list of ahk files so in my example above, i can only assign 4 unique hotkey but key combination is a personal choice of each user.
I have about 400-500 of such small scripts that needs to be implemented and given to users so you can imagine maint. nightmare this could create if i don't handle this well.
My questions are :
1) With this in mind, what's the best way to implement? Should I use, functions, includes or something else?
2) When user selects a hot key, I plan to capture their hotkey and script path and write them to master file which will be placed in startup folder. This way, I will have only one AHK file running (master.ahk) which will control execution of all the scripts. Is this a good approach? PROS and CONS if you have implemented something similar? I am trying to manage a central repository of all the AHK scripts and users will only have master script on their local drive.
I would appreciate if someone can lead me to similar implementation or blog post or any other references.
Thanks,
I am trying to automate series of tasks in/on a single instance of IE for intranet application. Flow looks something like below :-
1) Login to Twitter. Lets call this individual script as 1_login.ahk.
2) Compose a tweet. 2_compose.ahk
3) Search for keyword. 3_search_keyword_tweet.ahk
4) Retweet and like. 4_rt_like.ahk
In this example, I would like to have a functionality where each user can assign their own hotkeys. For Example, I may use Control + A to execute step#1(1_login.ahk) to login but other person might prefer Control + B to execute same script (i.e. 1_login.ahk). My intention is to build a small gui that lets them pick hotkey and select a file from their drive that they want autohotkeys assigned to. I have a master list of ahk files so in my example above, i can only assign 4 unique hotkey but key combination is a personal choice of each user.
I have about 400-500 of such small scripts that needs to be implemented and given to users so you can imagine maint. nightmare this could create if i don't handle this well.
My questions are :
1) With this in mind, what's the best way to implement? Should I use, functions, includes or something else?
2) When user selects a hot key, I plan to capture their hotkey and script path and write them to master file which will be placed in startup folder. This way, I will have only one AHK file running (master.ahk) which will control execution of all the scripts. Is this a good approach? PROS and CONS if you have implemented something similar? I am trying to manage a central repository of all the AHK scripts and users will only have master script on their local drive.
I would appreciate if someone can lead me to similar implementation or blog post or any other references.
Thanks,