Просмотр исходного кода

Wait for the program to launch before addressing it

Zachary Kotlarek 13 лет назад
Родитель
Сommit
8b2ef20953
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      dmx/rave.pl

+ 4 - 1
dmx/rave.pl

@@ -205,7 +205,10 @@ sub loadAudio($) {
 	system('open', '-a', 'QuickTime Player', $file);
 
 	# 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, 'delay 0.05');
 	push(@cmd, 'end repeat');