TaranVH / 2nd-keyboard

ALL of Taran's scripts - not just for the 2nd keyboard.
https://www.youtube.com/watch?v=O6ERELse_QY
1.66k stars 534 forks source link

Action Center keeps coming up when I press a hotkey #68

Closed freduard closed 5 years ago

freduard commented 5 years ago

So basically I made a hotkey for Premiere Pro to save the current file to another project because I use a template to open my project up and then save the file to the editing project when I start editing. But for some reason when I press F2 (my stroke) it brings up the action center. I thought maybe the keys that the AutoHotkey was pressing caused it to bring it up but I tried those hotkeys manually and it didn't come up. I'd be glad if you could help thanks!

Code: F2::

IfWinActive, ahk_class Premiere Pro

send ^+s send !d send C:\Users\aitfr\Documents\Adobe\Premiere Pro\13.0\Editing.prproj MouseClick Left, 820,580 , 1 Sleep 1 MouseClick Left, 1060,555 , 1

TaranVH commented 5 years ago

when you write a script, use comments to explain to yourself (and anyone reviewing the code, which is me) as to what each shortcut is supposed to do. ALT D, i guess, is supposed to highlight the address bar? Use CTRL L instead. ALT is dangerous. Avoid is as much as possible.

Also, clicking on your screen at specific coordinates is also dangerous. You don't know WHAT might be there. And you didn't even define your coordmode. Better look that up.

since you didn't comment your code, IDK what those clicks are supposed to do.

Anyway, you can just use TAB if you want to cycle through the available buttons. Or SHIFT TAB to cycle though them backwards. Do you want to hit the SAVE button? If so, something like this should work: sendinput, +{tab} sleep 10 sendinput, +{tab} sleep 10 sendinput, {enter}

Also, you can use msgbox, anywhere in your code to see if something has happened yet or not. Great for debugging.

freduard commented 5 years ago

Hey thanks for getting back to me. Yeah sorry, I forgot to comment the code, but thanks a lot for the help!

On Fri, Oct 26, 2018 at 3:16 AM TaranVH notifications@github.com wrote:

when you write a script, use comments to explain to yourself (and anyone reviewing the code, which is me) as to what each shortcut is supposed to do. ALT D, i guess, is supposed to highlight the address bar? Use CTRL L instead. ALT is dangerous. Avoid is as much as possible.

Also, clicking on your screen at specific coordinates is also dangerous. You don't know WHAT might be there. And you didn't even define your coordmode. Better look that up.

since you didn't comment your code, IDK what those clicks are supposed to do.

Anyway, you can just use TAB if you want to cycle through the available buttons. Or SHIFT TAB to cycle though them backwards. Do you want to hit the SAVE button? If so, something like this should work: sendinput, +{tab} sleep 10 sendinput, +{tab} sleep 10 sendinput, {enter}

Also, you can use msgbox, anywhere in your code to see if something has happened yet or not. Great for debugging.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TaranVH/2nd-keyboard/issues/68#issuecomment-433246523, or mute the thread https://github.com/notifications/unsubscribe-auth/AqbEjEyZaJ-466qZr1guiqppq3X1gpYNks5uolRggaJpZM4X7Rlg .