Detecting activity within a specific folder

Get help with using AutoHotkey and its commands and hotkeys
simonic99
Posts: 5
Joined: 13 Mar 2018, 12:10
Facebook: simonfhagan

Detecting activity within a specific folder

25 Aug 2018, 13:07

Hi All

A little conundrum for you...

I already have AHK controlling my editing software to render a video file to a specific folder using my editing software. My challenge is to pause the script until the write completes and then allow it to carry on. I don't want to use an onscreen ImageSearch because that ties up my computer. Can anyone offer a way I can get the script to detect when the write process has ended?

Thanks.
swagfag
Posts: 4243
Joined: 11 Jan 2017, 17:59

Re: Detecting activity within a specific folder

25 Aug 2018, 14:32

Code: Select all

while(!FileExist("C:\my_render.mp4"))
	Sleep 25
assuming the rendered file appears only after its been rendered. also pause is a bit ambiguous. this snippet will merely delay it until then
simonic99
Posts: 5
Joined: 13 Mar 2018, 12:10
Facebook: simonfhagan

Re: Detecting activity within a specific folder

25 Aug 2018, 16:46

OK thanks swag. I'd assumed the detection would be on creation. I'll give that a go.
simonic99
Posts: 5
Joined: 13 Mar 2018, 12:10
Facebook: simonfhagan

Re: Detecting activity within a specific folder

26 Aug 2018, 07:06

Actually, just noticed, that doesn't solve my problem. I need a way to detect activity within a specified folder, but the file name is created on the fly, so I can't address that in the script.

Any other ideas or is this just not possible in AHK?
User avatar
Scr1pter
Posts: 1220
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Detecting activity within a specific folder

26 Aug 2018, 07:30

Maybe you could compare the folder size of the output folder.
At the beginning of your script you let it check the size
As soon as it has become bigger, you let your script continue.

I've never done something like that, though.
No idea if this can do the job.

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: G502 FE, Jelly Comb Touchpad - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.32.00
User avatar
Nextron
Posts: 1380
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win10 AHK: Unicode x32

Re: Detecting activity within a specific folder

26 Aug 2018, 07:51

How about this:

Code: Select all

While !FileOpen("outputfile.mp4","r-")
	Sleep 500
MsgBox Done rendering
Assuming the rendering software doesn't allow accessing the file by other processes while it's writing.

Return to “Ask For Help”

Who is online

Users browsing this forum: aueva69, CarlV, dd900, Google [Bot], Johell, kczx3, mikeyww, SirSocks, Smile_, tatagi, vamba and 58 guests