2012年3月31日

[applescript]QuickTimePlayer7をbashから音声パンさせる

QuickTimePlayer7で再生中のムービーのステレオ出力を、シェルから制御するサンプルです

コントローラ側(bash)
# bash引数によるQT7のパンニング
for i in {-128..128}; do 
echo $i;
~/script/QT_ChangeSoundBalanceArgvTest.scpt $i;
sleep 0.01;
done;

AppleScript側
-- QT7 の各種パラメータを変更するApplescript
--
-- osascriptから呼び出して使用
--   引数1: 音声パン. L - R で -128.. 128 

on run argv
 tell application "QuickTime Player 7"
  set targetMovie to the name of document 1
  tell document targetMovie
   set sound balance to item 1 of argv
  end tell
 end tell
end run