PDA

View Full Version : AHK Help: Please



BoothThis
January 19th, 2012, 05:28 PM
Need this script to run in loop, looking for taking screen, send Send ^+a, sleep 1000, Send ^+a and repeat. Presently, the script will see ready.jpg after 1.jpg and will Send ^+a, sleep 1000, Send ^+a. Then it stops working for ready.jpg after 2.jpg and so on. It also ONLY works on the first firing sequence after fullscreen photobooth mode is started. Any consequtive firing sequence does not trigger the sequence. If I exit fullscreen photobooth mode, It is seen again.

Any help appreciated. Been working on this for a few days now with no real progress.



; loop forever monitoring the status of the photobooth screen by looking
; at the window title which is in the form:
; Breeze Systems Photobooth -
LookForTaking = 1
Loop
{
IfWinExist, Breeze Systems Photobooth
{
WinGetTitle, Title, Breeze Systems Photobooth
if Title contains taking.jpg
{
; ensure the photobooth window is active when ready screen is displayed to
; avoid problems with keyboard input focus being lost
IfWinNotActive, Breeze Systems Photobooth
{
WinActivate, Breeze Systems Photobooth
}

if LookForTaking
{
; yes, photobooth has just switched from 1.jpg,2.jpg,3.jpg, 4.jpg to taking.jpg
LookForTaking = 0
WinActivate, Breeze Systems Photobooth
if Title contains taking
{
; turn on light at switch 1
Send ^+a
; Sleep for 1 Sec while camera takes picture
Sleep 1000
; turn off light
Send ^+a
}
else
{

}
}
}
else if Title contains ready.jpg
{
LookForTaking = 1
}
}
else
{
LookForTaking = 1
}
Sleep 100 ; sleep for 1/10th sec to avoid hogging the processor
}
Return

neilneilb
January 20th, 2012, 05:23 AM
Need this script to run in loop, looking for taking screen, send Send ^+a, sleep 1000, Send ^+a and repeat. Presently, the script will see ready.jpg after 1.jpg and will Send ^+a, sleep 1000, Send ^+a. Then it stops working for ready.jpg after 2.jpg and so on. It also ONLY works on the first firing sequence after fullscreen photobooth mode is started. Any consequtive firing sequence does not trigger the sequence. If I exit fullscreen photobooth mode, It is seen again.

Any help appreciated. Been working on this for a few days now with no real progress.



; loop forever monitoring the status of the photobooth screen by looking
; at the window title which is in the form:
; Breeze Systems Photobooth -
LookForTaking = 1
Loop
{
IfWinExist, Breeze Systems Photobooth
{
WinGetTitle, Title, Breeze Systems Photobooth
if Title contains taking.jpg
{
; ensure the photobooth window is active when ready screen is displayed to
; avoid problems with keyboard input focus being lost
IfWinNotActive, Breeze Systems Photobooth
{
WinActivate, Breeze Systems Photobooth
}

if LookForTaking
{
; yes, photobooth has just switched from 1.jpg,2.jpg,3.jpg, 4.jpg to taking.jpg
LookForTaking = 0
WinActivate, Breeze Systems Photobooth
if Title contains taking
{
; turn on light at switch 1
Send ^+a
; Sleep for 1 Sec while camera takes picture
Sleep 1000
; turn off light
Send ^+a
}
else
{

}
}
}
else if Title contains ready.jpg
{
LookForTaking = 1
}
}
else
{
LookForTaking = 1
}
Sleep 100 ; sleep for 1/10th sec to avoid hogging the processor
}
Return



;----------------------------------------------------------------------------------
; Sample AutoHotkey script which resets settings after each sequence
; Switches the booth back to stills mode and a single color print.
;
; AutoHotKey is free and can be downloaded from:
; http://www.autohotkey.com
;
; This script works with:
; DSLR Remote Pro for Windows v1.9.1 or later
; NKRemote v1.4 or later
; PSRemote v1.9 or later
;
; This script comes with no warranty or support whatsoever and may
; be freely copied or modified as required.
;
; Written by Chris Breeze, www.breezesys.com
;
; UPDATES:
; 20 Feb 2011: Added resetting back to stills photo booth mode if video
; booth mode was used (DSLR Remote Pro for Windows v2.1 onwards)
; 1 Apr 2011: Activate window if not already active when ready screen is displayed
; to avoid problems with input focus being lost
;----------------------------------------------------------------------------------

; loop forever monitoring the status of the photobooth screen by looking
; at the window title which is in the form:
; Breeze Systems Photobooth -
LookForReady = 1
Loop

IfWinExist, Breeze Systems Photobooth
{
WinGetTitle, Title, Breeze Systems Photobooth
if Title contains taking.jpg
{
; ensure the photobooth window is active when ready screen is displayed to
; avoid problems with keyboard input focus being lost
IfWinNotActive, Breeze Systems Photobooth
{
WinActivate, Breeze Systems Photobooth
}

; Photobooth is displaying ready screen - are we looking for ready.jpg?
if LookForReady
{
; yes, photobooth has just switched from processing.jpg to ready.jpg
LookForReady = 0
WinActivate, Breeze Systems Photobooth
if Title contains taking
{
; switch from video booth mode back to stills photo booth mode
Send ^+a

sleep 1000

send^+a
}
else
{
; Switch back to color mode
;Send ^c

; reset the number of copies back to 1
;Send ^1
}
}
}
else if Title contains .jpg
{

{
; Photobooth is displaying ready screen - start looking for ready.jpg
LookForReady = 1
}
}
else
{
LookForReady = 1
}
Sleep 100 ; sleep for 1/10th sec to avoid hogging the processor
}
Return

BoothThis
January 20th, 2012, 08:23 AM
Neilneilb, your my hero. Not only did you get me started, but your rocked me a solid script. Thanks.

neilneilb
January 20th, 2012, 03:30 PM
No problem. Glad to help.