Explorar o código

Wait for the program to launch before addressing it

Zachary Kotlarek %!s(int64=13) %!d(string=hai) anos
pai
achega
8b2ef20953
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      dmx/rave.pl

+ 4 - 1
dmx/rave.pl

@@ -205,7 +205,10 @@ sub loadAudio($) {
 	system('open', '-a', 'QuickTime Player', $file);
 	system('open', '-a', 'QuickTime Player', $file);
 
 
 	# Get the document name
 	# Get the document name
-	my @cmd = ('tell application "QuickTime Player"');
+	my @cmd = ('repeat while application "QuickTime Player" is not running');
+	push(@cmd, 'delay 0.05');
+	push(@cmd, 'end repeat');
+	push(@cmd, 'tell application "QuickTime Player"');
 	push(@cmd, 'repeat while (count items of every document) < 1');
 	push(@cmd, 'repeat while (count items of every document) < 1');
 	push(@cmd, 'delay 0.05');
 	push(@cmd, 'delay 0.05');
 	push(@cmd, 'end repeat');
 	push(@cmd, 'end repeat');