I'm using AHK for very basic hot key creation of things I type sometimes hundreds of times a day and i am trying to figure out how to insert clipboard content into my hotkey
example
perform X on Y;sleep 60;perform Z on Y
The "y" changes while everything else stays the same, can I automatically insert clipboard content for y? I've read the documentation for clipboard and clipboardall but that seems to be for more complex scripting (either that or I just dont understand how it works in my scenario)
Is what I'm trying to do possible in a basic hotkey phrase or do i need to do it via script?
Probably a silly question with an easy answer
Re: Probably a silly question with an easy answer
Even a single basic hotkey phrase is executed using a script. So, yes.
Remember to use [code]CODE[/code]-tags for your multi-line scripts. Stay safe, stay inside, and remember washing your hands for 20 sec !
Re: Probably a silly question with an easy answer
so u want a hotkey to insert the phrase
press q
, where Y is the contents of ur Clipboard?perform X on Y;sleep 60;perform Z on Y
Code: Select all
q::Send % "{Text}perform X on " Clipboard ";sleep 60;perform Z on " Clipboard
Re: Probably a silly question with an easy answer
Thank you for the example, looks like I can improve a lot of my basic AHKs. I was just not using the right option for what I was trying to do. I was just using text expansionswagfag wrote: ↑02 Jun 2020, 09:21so u want a hotkey to insert the phrase, where Y is the contents of ur Clipboard?perform X on Y;sleep 60;perform Z on Y
press qCode: Select all
q::Send % "{Text}perform X on " Clipboard ";sleep 60;perform Z on " Clipboard
Code: Select all
::;q;;perform X on Y;sleep 60;perform Z on Y
Re: Probably a silly question with an easy answer
Hope you dont mind another question, the script example you provided does exactly what it should. how do I prevent it from executing every time I press the trigger? I used p instead of q. I tried to make it use a 3 letter trigger, which is how my basic text expansion was triggered but that doesn't appear to workswagfag wrote: ↑02 Jun 2020, 09:21so u want a hotkey to insert the phrase, where Y is the contents of ur Clipboard?perform X on Y;sleep 60;perform Z on Y
press qCode: Select all
q::Send % "{Text}perform X on " Clipboard ";sleep 60;perform Z on " Clipboard
Code: Select all
::;pmp::pimp -x target;sleep 60;pimp -o target
With the script every time I enter p it outputs the contents of the script, which is obviously going to result in a lot of backspacing or disabling the script.
I tried using p & m so it requires both keys to be pressed but it breaks the script.
If you can just point in the right direction in the documentation I can likely figure it out
Re: Probably a silly question with an easy answer
I figured out a way to get it to work, not sure if it is the "right" way, but it works.
I just use ^p to trigger the script instead of p
I just use ^p to trigger the script instead of p