ラベル AppleScript の投稿を表示しています。 すべての投稿を表示
ラベル AppleScript の投稿を表示しています。 すべての投稿を表示

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

2011年3月19日

QuickTimePlayer 7で再生中のファイルの再生速度を変更するスクリプト

QuickTimePlayer 7で, 再生中のファイルの再生速度を変更するスクリプト.

Change the playback speed of a file playing on QuickTimePlayer 7

-- ムービーの再生速度を変更する
tell application "QuickTime Player 7"
  set targetMovie to "Kick"
  tell document targetMovie
    set preferred rate to 2.0
    play
  end tell
end tell

3行目のKickは, QuickTime上で見えているコンテンツタイトルに変更のこと.

キーワード"rate"ではなく, "preffered rate"を使うのがよいみたい.

動作検証:
OSX: 10.6.6
ScriptEditor: 2.3(118)

Finder ラベルを変更するAppleScript

選択したFinder項目のラベルを変更するスクリプト.
(ドロップレットにする場合)

Change the Label of Selected Finder Item
Using as a dropplet

-- Finder選択項目のラベルを変更する
on open theDrops
  tell application "Finder"
    if number of (selection as list) = 1 then
      set selectedItem to first item of (selection as list)
      set colVal to label index of selectedItem
      set colVal to (colVal + 1) mod 8
      set label index of selectedItem to colVal
    end if
  end tell
end open

動作検証:
OSX: 10.6.6
ScriptEditor: 2.3(118)