AutoHotKey with Greenshot

Get help with using AutoHotkey and its commands and hotkeys
Senior47
Posts: 1
Joined: 26 Mar 2019, 15:21

AutoHotKey with Greenshot

26 Mar 2019, 15:34

Script to take screenshot from eBook, click on mouse-button on fixed position (going to next page in eBook) X number of time. It works, but take 2 screenshot of every page, and I don't understand why!
The script: (original from this post https://autohotkey.com/board/topic/58115-auto-screen-capture-script/)

Code: Select all

^!R:: 			; CTRL+ALT+R to run the script

	loop, 6 		; keep going for n number of times in this case 6 times
		{	 
			Send +{Printscreen}			;keystroke [shift]+[PrintScreen]
			Sleep, 3500				; delay for 3.5 seconds
			Click, 2220, 625     			; click button at fixed possition
			Sleep, 3500				; delay for 3.5 seconds
		}
	return
Any suggestion/solutions?
________________________________________ :)
Update/more info..
I have a program called BlueStacks running and open, and this script is supposed to take screenshot of that window. It does, but it takes 2 screenshots before the Click command is executed. It seems like both Bluestacks and "Program Manager" takes screenshots... ( who is "Program Manager" anyway? )
I've copied some lines from the log, maybe its more clear than my explanation...
AHK's log:

007: Send,+{Printscreen} (0.05)
009: Click,2250, 675 (0.16)
011: Sleep,1500 (1.50)
012: }
007: Send,+{Printscreen} (0.02)
009: Click,2250, 675 (0.27)
011: Sleep,1500 (1.50)
012: }
013: Return (66.47)

A0 02A i d 1.77 LShift BlueStacks
2C 137 i d 0.01 PrintScreen
2C 137 i u 0.02 PrintScreen
A0 02A i u 0.02 LShift
A0 02A i d 1.66 LShift Program Manager
2C 137 i d 0.00 PrintScreen
2C 137 i u 0.00 PrintScreen
A0 02A i u 0.02 LShift

Hope for any advice...
________________________________________

More Update/more info.. / answering myself :)

Got it: Two lines with "WinActivate" solved my problem!
Final script:

Code: Select all

^!R::            						; CTRL+ALT+R to run the script
	
	
	loop, 4  							; keep going for n number of times in this case 4 times
		{
		WinActivate, BlueStacks			; selects the program window

		Send +{Printscreen}				; keystroke [shift]+[PrintScreen]
		
		Sleep, 1500						; delay for 1.5 seconds - necessary
		
		WinActivate, Program Manager	; selects the desktop
		
		Click, 2250, 675     			; mouse click
		
		Sleep, 1500						; delay for 1.5 seconds
		}
	return

Return to “Ask For Help”

Who is online

Users browsing this forum: AHK_user, densch, Odlanir, omareg94, toni and 59 guests