Diese AppleScript action importiert die input Dateien in iTunes, …
konvertiert MP3 zu AAC (wenn notwendig) und löscht die MP3 Dateien in iTunes (in der Bibliothek und im Finder).
Es löscht aber nicht die input Dateien.
Falls ein Fehler beim Konvertieren auftritt, wird ein Dialog angezeigt und die importierte MP3 Datei nicht gelöscht.
Es löscht aber nicht die input Dateien.
Falls ein Fehler beim Konvertieren auftritt, wird ein Dialog angezeigt und die importierte MP3 Datei nicht gelöscht.
Show Plain Text
- on run {input, parameters}
- with timeout of 3600 seconds
- tell application "iTunes"
- set importedTracks to add input
- set currentEncoder to current encoder
- set current encoder to encoder "AAC encoder"
- set tracksToDelete to {}
- repeat with aTrack in (get importedTracks)
- if kind of aTrack is not "AAC Audio file" then
- try
- set aacTrack to convert aTrack
- set end of tracksToDelete to contents of aTrack
- on error e
- display dialog "error: " & e
- end try
- end if
- end repeat
- end tell
- repeat with aTrack in tracksToDelete
- tell application "iTunes"
- set filePath to location of aTrack
- delete aTrack
- end tell
- tell application "Finder" to delete filePath
- end repeat
- tell application "iTunes" to set current encoder to currentEncoder
- end timeout
- return input
- end run