iTunesを使いこなそう!for Mac Part 65

このエントリーをはてなブックマークに追加
351名称未設定
コメント欄から特定の文字列を消すスクリプト
tell application "iTunes"
if selection of front browser window is {} then
display alert "Select track(s) to process." as critical buttons "Cancel"
else
set delString to "ここに消したい文字列を入れる"
set selectedTracks to selection
set TID to AppleScript's text item delimiters
set FI to fixed indexing
set fixed indexing to true
try
repeat with aTrack in selectedTracks
tell aTrack
if comment contains delString then
set aText to comment as string
set AppleScript's text item delimiters to delString
set aList to every text item of aText
set AppleScript's text item delimiters to ""
set aText to aList as string
set comment to aText
end if
end tell
end repeat
end try
set fixed indexing to FI
set AppleScript's text item delimiters to TID
display alert "Process was completed." as critical buttons "OK"
end if
end tell