Simple Loop command issue

Get help with using AutoHotkey and its commands and hotkeys
opc121177
Posts: 8
Joined: 15 Apr 2017, 10:54

Simple Loop command issue

17 Aug 2019, 10:19

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
hd0202
Posts: 165
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: Simple Loop command issue

17 Aug 2019, 10:43

remove the 'exit' command

Hubert
opc121177
Posts: 8
Joined: 15 Apr 2017, 10:54

Re: Simple Loop command issue

17 Aug 2019, 11:02

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?
hd0202
Posts: 165
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: Simple Loop command issue

17 Aug 2019, 11:11

how is the loop triggered ?

Hubert
opc121177
Posts: 8
Joined: 15 Apr 2017, 10:54

Re: Simple Loop command issue

17 Aug 2019, 11:15

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.
Last edited by opc121177 on 17 Aug 2019, 11:25, edited 1 time in total.
hd0202
Posts: 165
Joined: 04 Oct 2013, 03:07
Location: Germany near Cologne

Re: Simple Loop command issue

17 Aug 2019, 11:24

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
opc121177
Posts: 8
Joined: 15 Apr 2017, 10:54

Re: Simple Loop command issue

17 Aug 2019, 11:27

Ok I think this may be beyond me, I think I’ll have to enlist some help 👍

Return to “Ask For Help”

Who is online

Users browsing this forum: c7aesa7r, cmili, omar bishr, serlu and 55 guests