Если вы согласны с временным преобразованием дорожек в медиатеку iTunes , вы можете использовать AppleScript для преобразования дорожки, удаления ссылки на преобразованную дорожку и, наконец, переместить преобразованный файл в любое удобное для вас место.
Обычный AppleScript имеет мало возможностей для гладкого интерфейса, но следующий скрипт может сделать то, что вы хотите. Вставьте его в Script Editor (или AppleScript Editor в Snowy) и сохраните как «комплект приложений» («application» в Snowy). Чтобы использовать его, настройте параметры конвертации (« Настройки импорта») в iTunes, выберите несколько треков в iTunes, затем перетащите папку в сохраненное приложение. Обратите внимание, что вновь преобразованные файлы будут перезаписывать уже существующие файлы в удаленной папке (если их имена идентичны). Вероятно, лучше всего отбрасывать пустые папки, если вы не уверены, что хотите перезаписать их. Вы даже можете получить некоторые теги ID3v2 из процесса (я делал в некоторых тестах, но это зависит от того, что iTunes решит делать).
on run
display dialog "Drop a folder on this application to convert iTune's selected tracks and place them the dropped folder." & return & return & "The converted files will be whatever is selected in iTunes “Import Settings”." with title "About"
return
-- Test invocation:
"/tmp/convert_to_external"
alias POSIX file result
open {result}
end run
on open theItems
if length of theItems is 0 then
display dialog "No items dropped? Only a single, plain folder should be dropped." with title "Error: Drop Only a Single Folder"
return
end if
if length of theItems is greater than 1 then
display dialog "Too many items have been dropped. Only a single, plain folder should be dropped." with title "Error: Drop Only a Single Folder"
return
end if
set theItem to first item of theItems
set info to info for theItem
if not folder of info or package folder of info then
display dialog "“" & POSIX path of theItem & "” is not a plain folder. Only a single, plain folder should be dropped." with title "Error: Drop Only a Single Folder"
return
else
|convert iTunes selection into folder|(theItem)
end if
end open
to |convert iTunes selection into folder|(folderRef)
try
do shell script "test -d " & quoted form of POSIX path of folderRef
on error m
display dialog "Destination (" & destinationForShell & ") not accessible?" & return & m
return
end try
tell application "iTunes"
set trackList to selection
repeat with selectedTrack in trackList
try
set convertedTrack to my convertTrack(selectedTrack)
set convertedFile to location of convertedTrack
my deleteTrackReference(convertedTrack) -- only delete the iTunes ref, not the track's file
my moveItemToFolder(convertedFile, folderRef)
on error m
tell me to display dialog m with title "Error During Conversion/Removal/Move" -- giving up after 30
end try
end repeat
end tell
end |convert iTunes selection into folder|
to convertTrack(aTrack)
if class of aTrack is list then error "Must pass a single track."
using terms from application "iTunes"
set questionTimeout to 10
set conversionTimeout to 600
display dialog "About to start conversion of “" & name of aTrack & "”. Select a timeout in seconds for the conversion (conversion will auto-start in " & questionTimeout & " seconds):" default answer conversionTimeout with title "Conversion Time Limit" giving up after questionTimeout
try
set conversionTimeout to (text returned of result) as number
end try
set convertedTrack to missing value
with timeout of conversionTimeout seconds -- conversion may take longer than the deafult 120 second AppleEvent RPC timeout
try
set convertedTrack to convert aTrack
on error
error "Error while converting track."
end try
end timeout
if convertedTrack is not missing value then return first item of convertedTrack
error "Abandoning track conversion after timeout." & return & m
end using terms from
end convertTrack
to deleteTrackReference(aTrack)
try
tell application "iTunes" to set mainLibrary to ¬
first library playlist of (first source whose kind is library)
on error
error "Unable to find main library playlist object."
end try
using terms from application "iTunes"
try
set convertedTrackInMainLibrary to ¬
(first track of mainLibrary whose database ID is (get database ID of aTrack))
on error
error "Unable to find track object in main library playlist."
end try
try
delete convertedTrackInMainLibrary -- deletes the reference, not the actual file
on error
error "Unable to delete track from main library playlist."
end try
end using terms from
end deleteTrackReference
to moveItemToFolder(itemRef, folderRef)
set itemPath to POSIX path of itemRef
set folderPath to POSIX path of folderRef
try
do shell script "mv " & quoted form of itemPath & " " & quoted form of folderPath
on error m
error "Unable to move item (" & itemPath & ") to destination (" & folderPath & "):" & return & m
end try
end moveItemToFolder