Page 1 of 1

Simple Loop command issue

Posted: 17 Aug 2019, 10:19
by opc121177
Hi guys,

Sorry im quite new to AHK. I'm trying to create a loop command that will play an MP4 and then close when the title of the software we use is present. It almost works and seems to activate when needed, just doesn't loop and stay open. Any help would be greatly appreciated:

Code: Select all

SetTitleMatchMode, 2


Loop,
{
	IfWinExist, Breeze Systems Photobooth - 
	{
		WinGetTitle, Title, Breeze Systems Photobooth - 
		if title contains video_processing
		{
			Run, C:\Users\PaulC\Google Drive\Pauls Work\MyFunPhotoBooth\Templates\Mirror\Animations\MFPB Videos\2b.mp4 --fullscreen
			Sleep, 7000
			WinClose Movies & TV
			Exit,
		}
		
	}	
}
TIA John

Re: Simple Loop command issue

Posted: 17 Aug 2019, 10:43
by hd0202
remove the 'exit' command

Hubert

Re: Simple Loop command issue

Posted: 17 Aug 2019, 11:02
by opc121177
Hubert, that seems to have kept the script open but the video keeps repeating as the processing screen is still present. I just want the video to play once. Any ideas?

Re: Simple Loop command issue

Posted: 17 Aug 2019, 11:11
by hd0202
how is the loop triggered ?

Hubert

Re: Simple Loop command issue

Posted: 17 Aug 2019, 11:15
by opc121177
I just wanted it running the entire time after launching the script. Then when the programs screen is present it launches the MP4 once and closes it.

Re: Simple Loop command issue

Posted: 17 Aug 2019, 11:24
by hd0202
loop - play always
no loop - play once
I think you must add a selection for the MP4-file you want to play and start the run only when the selection has changed

and ... add a sleep at the end of the loop to avoid 100% cpu usage

Hubert

Re: Simple Loop command issue

Posted: 17 Aug 2019, 11:27
by opc121177
Ok I think this may be beyond me, I think I’ll have to enlist some help 👍