[AppleScript]QuickTime7でのビデオトラックの削除
set FileResult to choose file "変更するファイルを選択"
set savefolder to choose folder with prompt ("FLVファイルの保存先を選択してください。" as Unicode text)
set destinationFolder to savefolder as Unicode text
tell application "Finder"
set theName to name of FileResult
set newfile to destinationFolder & text 1 thru -4 of theName & "mov" as Unicode text
set newfilepass to POSIX path of newfile as Unicode text
end tell
tell application "QuickTime Player 7"
launch
activate
open FileResult
---------ファイルのオープン判定
set theStateChk to 1
repeat while theStateChk ≤ 1
set theLoadState to get load state of document 1 as Unicode text
try
if theLoadState is "complete" then
set theStateChk to theStateChk + 1
else
set theStateChk to 1
delay 1
end if
end try
end repeat
----------ビデオトラックを削除する
set theTracksDocument to tracks of document 1
set theTracksCount to (count of theTracksDocument)
set theTrackNo to 1
repeat while theTrackNo ≤ theTracksCount
tell document 1
try
if kind of track theTrackNo is "ビデオ" then
try
delete track theTrackNo
end try
else
set theTrackNo to 1
end if
end try
set theTrackNo to theTrackNo + 1
end tell
end repeat
----------ファイルを保存
save self contained document 1 in newfilepass
close document 1
end tell
「delete_video_track.rtf」をダウンロード
「delete_video_track.scpt.zip」をダウンロード
| 固定リンク
「QuickTime」カテゴリの記事
- [AppleScript]ffmpeg用のコマンドを整形する(ムービーから選択範囲を切り出す)(2017.01.15)
- XviD codec for Mac(2015.12.08)
- [QuickTime]フルスクリーン+リピート再生(2016.10.05)
- [QuickTime]ムービーが保存出来ない(ムービーに不正な時間情報が含まれています。)(2015.04.12)
- [Component]Flip4Mac WMVComponent 有料化かぁ(2014.06.14)