Page 1 of 1

Using greenshot with AHK

Posted: 10 Oct 2017, 19:33
by monkkey
Hi, I wanted to make a script that repeatedly takes a screenshot of my screen using AHK. However, the hotkey I set up for greenshot doesn't seem to work. Here is my code:

Code: Select all

Send {ScrollLock}
I set up the program to take a screenshot when I press the ScrollLock key, but for some reason, AHK doesn't trigger it when I press the '=' key. Am I doing something wrong?

Re: Using greenshot with AHK

Posted: 10 Oct 2017, 20:01
by gwarble

Re: Using greenshot with AHK

Posted: 10 Oct 2017, 20:24
by monkkey
Unfortunately, that didn't seem to work. I wonder, could it be because greenshot isn't the window that's in focus?

Re: Using greenshot with AHK  Topic is solved

Posted: 10 Oct 2017, 22:03
by gwarble
I don't know anything about greenshot, personally i would try do it with pure ahk

but you can try to go back to the style you had above but without the {}'s around the send command, with a return after it (on my phone now or i'd show in code), then add in a "winactivate before the send if thats what greenshot requires

Re: Using greenshot with AHK

Posted: 11 Oct 2017, 02:15
by Tomer
you can use nircmd.exe

for example:

Code: Select all

; Save 10 screenshots in a loop, and wait 60 seconds between the screenshot save calls. The filenames of the screenshot will contain the time and date of the saved screenshot.
run, nircmd.exe loop 10 60000 savescreenshot c:\temp\scr~$currdate.MM_dd_yyyy$-~$currtime.HH_mm_ss$.png

Re: Using greenshot with AHK

Posted: 11 Feb 2018, 14:45
by broccolilili
I did it like this, because send key didnt work on greenshot neither. so i did a click on greenshot in taskbar, then sent the key, then back to the window i wanted to capture

MsgBox, click on the window you wana capture thx
Loop, 1080
send, {PgDn}
Sleep, 400
Click 1640, 1070
Sleep, 700
Send, {Printscreen}
Sleep, 300
Click 50,200