このスクリプトは、WAV ファイルの名前を AIF に変更し、各ファイルの最後に 2 秒間の無音を追加してから、WAV ファイルを削除し、すべてのコンテンツをルート ディレクトリに移動し、空のフォルダーを削除します。
問題は、Applescripts 経由で「do shell script」行が実行されないことです。
do shell script "find " & rootDirectory & " -name \\*.wav -exec sox {} {}.aif pad 0 2 \\;"
「doスクリプト」として実行すれば問題ありません。
スクリプト:
tell application "Finder" to set rootDirectory to (target of Finder window 1) as string
set rootDirectory to quoted form of POSIX path of rootDirectory
do shell script "find " & rootDirectory & " -name \\*.wav -exec sox {} {}.aif pad 0 2 \\;" -- change to AIF and add 2 second silence
delay 10
do shell script "find " & rootDirectory & " -name \\*.wav -exec rm {} \\;" -- delete WAV files
delay 5
do shell script "find " & rootDirectory & " -type f -exec mv {} " & rootDirectory & " \\;" --Move all files into rootDirectory
do shell script "find " & rootDirectory & " -depth -type d -exec rmdir {} " & " \\;" -- Remove all subdirectories of XMoveTo Root.app:
「Do Script」回避策:
tell application "Terminal"
activate
do script "find " & rootDirectory & " -name \\*.wav -exec sox {} {}.aif pad 0 2 \\;" in front window
delay 10
do script "find " & rootDirectory & " -name \\*.wav -exec rm {} \\;" in front window
end tell
理想的には、すべて「do shell script」経由で実行できれば素晴らしいことです。また、名前を .aif に変更するときに .wav を失う方法はありますか? ファイルはこのように出てきます。newfile.wav.aif