What do I need to learn?
-
- Posts: 16
- Joined: 10 Dec 2020, 14:36
What do I need to learn?
Hello,
At work, I have an addon, a temporary addon, that I need to load up if FF closes for whatever reason. This add on is for one of the tools I use everyday, so I have to readd it to the browser.(Or I could learn how to make it a permanent addon but that is for later)
I have some limited experience with AHK so my question is:
If I give a set of steps I need to do, can someone point me to the concepts I need to learn? In that I can go to Joe's videos or YT, or even Udemy if need be to learn out to make a script I can call with a hot key that will do what I need?
The steps are:
Open a new FF tab using Control T
enter about:debugging in the address bar
click This Firefox
Click Load Temporary Add-on...
Either fill in the File Name or click on the file name to select it
Click Ok
Exit/close new tab
The goal is to learn how to do this myself. I just don't know what I need to learn.
Many thanks,
Dave
At work, I have an addon, a temporary addon, that I need to load up if FF closes for whatever reason. This add on is for one of the tools I use everyday, so I have to readd it to the browser.(Or I could learn how to make it a permanent addon but that is for later)
I have some limited experience with AHK so my question is:
If I give a set of steps I need to do, can someone point me to the concepts I need to learn? In that I can go to Joe's videos or YT, or even Udemy if need be to learn out to make a script I can call with a hot key that will do what I need?
The steps are:
Open a new FF tab using Control T
enter about:debugging in the address bar
click This Firefox
Click Load Temporary Add-on...
Either fill in the File Name or click on the file name to select it
Click Ok
Exit/close new tab
The goal is to learn how to do this myself. I just don't know what I need to learn.
Many thanks,
Dave
Re: What do I need to learn?
Ideas are below. You can read about the commands. Don't worry; there is plenty to learn!
Code: Select all
file = ....json ; Change as needed
F3::
Run, firefox.exe about:debugging#/runtime/this-firefox
WinWaitActive, Mozilla Firefox ahk_class MozillaWindowClass ahk_exe firefox.exe,, 5
If ErrorLevel
Return
Sleep, 2000
Send {Tab 6}`n
WinWaitActive, Select manifest ahk_class #32770 ahk_exe firefox.exe,, 5
If ErrorLevel
Return
SendInput {Text}%file%
; Send `n
Return
-
- Posts: 16
- Joined: 10 Dec 2020, 14:36
Re: What do I need to learn?
Hello and thank you.
I guess I will be digging into the AHK command syntax yes?
As I wanted to hit F3 and run the script
Questions will be coming!!
I guess I will be digging into the AHK command syntax yes?
As I wanted to hit F3 and run the script
Questions will be coming!!
-
- Posts: 16
- Joined: 10 Dec 2020, 14:36
Re: What do I need to learn?
Hello Mike,
So am I correct in assuming that the F3:: line will invoke the rest of the script when it is pressed?
I have filled in the path to the json file and added firefox.exe to my PATH as it was not there.
Thanks,
Dave
So am I correct in assuming that the F3:: line will invoke the rest of the script when it is pressed?
I have filled in the path to the json file and added firefox.exe to my PATH as it was not there.
Thanks,
Dave
-
- Posts: 16
- Joined: 10 Dec 2020, 14:36
Re: What do I need to learn?
Hello Mike,
Thank you very much for the helping hand!!
The script runs fine. I just need to add it to Joe Glines add to startup script.
Now for a wrinkle:
Let's say I forget to run this and open FF and not via the script.
[Mod edit: [code][/code] tags added.]
Is my thought process right here?
Thank you very much for the helping hand!!
The script runs fine. I just need to add it to Joe Glines add to startup script.
Now for a wrinkle:
Let's say I forget to run this and open FF and not via the script.
Code: Select all
file = ....json ; Change as needed
F3::
;Run, firefox.exe about:debugging#/runtime/this-firefox
Send Ctl-T to open a new tab
SendInput about:debugging#/runtime/this-firefox
Send {Tab 6}`n
WinWaitActive, Select manifest ahk_class #32770 ahk_exe firefox.exe,, 5
If ErrorLevel
Return
SendInput {Text}%file%
Send {Enter}
Return
Is my thought process right here?
Re: What do I need to learn?
Easiest thing: try it! Try the original script first. If it failed, try your update next.
You have the right idea. Might need a Sleep somewhere.
You have the right idea. Might need a Sleep somewhere.
-
- Posts: 16
- Joined: 10 Dec 2020, 14:36
Re: What do I need to learn?
Hi Mike,
Thanks for the reply.
The original script works great so no issues there.
I will let you know how the new script runs.
Dave
Thanks for the reply.
The original script works great so no issues there.
I will let you know how the new script runs.
Dave
Re: What do I need to learn?
OK. I mean that the first one might work again, but give it a go.
-
- Posts: 16
- Joined: 10 Dec 2020, 14:36
Re: What do I need to learn?
Ok so based on your initial script, which runs like a champ, I created an off shoot for when FF is already open:
[Mod edit: [code][/code] tags added.]
I am kind of stuck on the last command once I put the file name in. I have tried:
Where am I going wrong? Or do I need another sleep?
Thanks
Code: Select all
<insert file path info here>
F3::
Send ^+T about:debugging#/runtime/this-firefox
WinWaitActive, Mozilla Firefox ahk_class MozillaWindowClass ahk_exe firefox.exe,, 5
If ErrorLevel
Return
Sleep, 2000
Send {Tab 6}`n
WinWaitActive, Select manifest ahk_class #32770 ahk_exe firefox.exe,, 5
If ErrorLevel
Return
Sleep, 2000
SendInput {Text}%file%
Sleep, 1000
Send !+o
I am kind of stuck on the last command once I put the file name in. I have tried:
Code: Select all
!+o
Send {Enter}
Send `n
Thanks
Last edited by gregster on 15 Oct 2021, 21:00, edited 1 time in total.
Reason: Please use code tags. Thank you!
Reason: Please use code tags. Thank you!
Re: What do I need to learn?
The original script worked for me in both situations. If it did not work at your end, you could display both of the ErrorLevels to see what they are. I am not sure what your Alt+Shift+O is supposed to do. In any case, you just need to use whatever key sequence you would be using manually. In your testing, I think that debugging would require you to figure out what is happening at each step, to know what should happen next. I think that after sending %file%, you will probably want {Enter} after that.