How do I write a script to wait for VirtualDub to finish its process

Hey everyone, I am new here. I’ve been looking all over the place for an answer to this question! Can’t find it, so I’m finally asking.
I’m running a application, VirtualDub, via Wine that splits a .MOV file into even and odd jpegs, A0001.jpg - A0804.jpg and B0001.jpg - B0804.jpg (or however many frames it ends up having). It takes a few minutes and the length of time depends on how big the original .MOV file is. My end goal is to have two separate .MOV files, “A” based on the even jpegs and “B” based on the odd.

My question is: How do I get Applescript to wait until VirtualDub is done splitting the original file? I’m sort of at a loss on this one.

If you are interested in the rest of my process, feel free to ask!

warmly,

Luke

Hi,

I have to deal with a similar case with a scheduled shutdown to wait for Quicktime Player to finish an export, or for the Finder to finish a big copy. (Must be saved as an applet ! )

Here’s an abstract of that script…


on idle
	tell application "System Events"
		set w to {}
		try
			set w to name of every window of application process "APP NAME"
		end try
	end tell
	if (not (w contains "WINDOW NAME")) then
		(*** FINALIZE HERE ***)
	end if
	return 60 -- check every minute
end idle

However, I dont know if that will work for you, given that you are using a Wine app.
My script assumes: (1) the window dissapears upon job completion, and (2) a native OSX app.
– but you might still manage.
experiment first in the Script Editor with:


tell application "System Events"
	set w to {}
	try
		set w to name of every window of application process "APP NAME"
	end try
end tell
get w

until you find the window name to target.

Model: PPC G4 Dual-800Mhz
AppleScript: 1.10.7
Browser: Safari 533.19.4
Operating System: Mac OS X (10.4)