Hello,
At the moment i am using AutoHotkey Version 2, script to open-launch Firefox as my current example below.
#!f::Run "C:\Program Files\Mozilla Firefox\firefox.exe"
What i really would like to change, or a new script to do is.
Using windows key # and Alt ! Both pressed same time, (As in my current script) then press F key and again press F key
(Twice within say 2 seconds, as a time example)
Hope i make sense in what i am trying to achieve, as a script if possible?
If so, it would be wonderful if someone could please help with, example script.
Thank you in advanced.
Help modifing or creating new script in V2 Please Topic is solved
-
- Posts: 4
- Joined: 27 May 2023, 18:37
-
- Posts: 4
- Joined: 27 May 2023, 18:37
Re: Help modifing or creating new script in V2 Please
Hello,
Thank you Rohwedder, for your reply and help with posting an example link to look at.
To be honest I have no idea on how to make a scrip from that example. I am a newbie to AutoHotkey and trying to get more understanding on making scripts.
I have a rethink and will try to explain below.
Now I am using AutoHotkey Version 2, script to launch Firefox browser, Notepad++, and quite a few other apps as example.
To launch Firefox in my current script
#!f::Run "C:\Program Files\Mozilla Firefox\firefox.exe"
This works but what I would really like is a script that can work as above but where f is in the script, it would be...as below.
Example to launch Firefox, hold down Windows key and Alt keys together then click M key and then click the F key.
Example for Notepad++ would be, hold down Windows key and Alt keys together then click N key and then click the P key.
Is a script like this possible please. Can you, or someone with more knowledge on writing scripts help in making a script that would achieve this.
Then from the example, I can add more programs to the script that I would like to launch.
Thank you in advance for anyone that can help.
Thank you Rohwedder, for your reply and help with posting an example link to look at.
To be honest I have no idea on how to make a scrip from that example. I am a newbie to AutoHotkey and trying to get more understanding on making scripts.
I have a rethink and will try to explain below.
Now I am using AutoHotkey Version 2, script to launch Firefox browser, Notepad++, and quite a few other apps as example.
To launch Firefox in my current script
#!f::Run "C:\Program Files\Mozilla Firefox\firefox.exe"
This works but what I would really like is a script that can work as above but where f is in the script, it would be...as below.
Example to launch Firefox, hold down Windows key and Alt keys together then click M key and then click the F key.
Example for Notepad++ would be, hold down Windows key and Alt keys together then click N key and then click the P key.
Is a script like this possible please. Can you, or someone with more knowledge on writing scripts help in making a script that would achieve this.
Then from the example, I can add more programs to the script that I would like to launch.
Thank you in advance for anyone that can help.
Re: Help modifing or creating new script in V2 Please
Hallo,
Windows key should be avoided! Otherwise Windows could do funny things.
Therefore, hold down left control and left alt key and type your 2 letters. Try:
Windows key should be avoided! Otherwise Windows could do funny things.
Therefore, hold down left control and left alt key and type your 2 letters. Try:
Code: Select all
<^LAlt::
<!LCtrl::
Input, Keys, ML2T4 ;2 Keys in < 4 seconds
KeyWait, LAlt
KeyWait, LCtrl
Switch, Keys
{
Case "mf":Run "C:\Program Files\Mozilla Firefox\firefox.exe"
Case "np":Run "C:\Program Files\notepad++.exe"
Default:ComObjCreate("SAPI.SpVoice").Speak("you typed " SubStr(Keys,1,1) " " SubStr(Keys,0))
}
Return
-
- Posts: 4
- Joined: 27 May 2023, 18:37
Re: Help modifing or creating new script in V2 Please
Hello,
Thank you Rohwedder, for your reply and help. Very much appreciated.
This script works a treat. If I may ask, Is there a way to make this script work with AutoHotkey Version 2. As this is what I use on my main PC.
Currently this script needs AutoHotkey version 1, which I would have to install along side with version 2.
I have read where Version 2 has many advantages, and version 1 is now deprecated.
So if Version 2 is better going forward, can this script be changed to work with AHK Version 2 ?
Rohwedder, thanks again for your time and help.
Thank you Rohwedder, for your reply and help. Very much appreciated.
This script works a treat. If I may ask, Is there a way to make this script work with AutoHotkey Version 2. As this is what I use on my main PC.
Currently this script needs AutoHotkey version 1, which I would have to install along side with version 2.
I have read where Version 2 has many advantages, and version 1 is now deprecated.
So if Version 2 is better going forward, can this script be changed to work with AHK Version 2 ?
Rohwedder, thanks again for your time and help.
Re: Help modifing or creating new script in V2 Please Topic is solved
Sorry, I often get the dialects mixed up.
Code: Select all
#Requires AutoHotkey v2.0
<^LAlt::
<!LCtrl::
{
ih := InputHook("ML2T4") ;2 Keys in < 4 seconds
ih.Start(), ih.Wait(), KeyWait("LAlt"), KeyWait("LCtrl")
Switch Keys:= ih.Input
{
Case "mf":Run "C:\Program Files\Mozilla Firefox\firefox.exe"
Case "np":Run "C:\Program Files\notepad++.exe"
Default:ComObject("SAPI.SpVoice").Speak("you typed " SubStr(Keys,1,1) " " SubStr(Keys,-1))
}
}
-
- Posts: 4
- Joined: 27 May 2023, 18:37
Re: Help modifing or creating new script in V2 Please
Hello Rohwedder,
You really have given me something much better to work with.
Much appreciated for all your help.
Danke
You really have given me something much better to work with.
Much appreciated for all your help.
Danke