Se você está certo em temporariamente ter as trilhas convertidas na sua biblioteca do iTunes , você pode usar o AppleScript para converter a trilha, remover a referência à trilha convertida e finalmente mover o arquivo convertido onde quer que seja. você gosta.
O AppleScript simples tem pouca capacidade de interface do usuário, mas o script a seguir pode fazer o que você deseja. Cole-o no Editor de Script (ou Editor AppleScript em Snowy) e salve-o como um “pacote de aplicativos” (“aplicativo” em Snowy). Para usá-lo, configure suas configurações de conversão ( Importar configurações ) no iTunes , selecione algumas faixas no iTunes e solte uma pasta no aplicativo salvo . Observe que os arquivos recém-convertidos substituirão os arquivos pré-existentes na pasta removida (se os nomes forem idênticos). É provavelmente melhor deixar pastas vazias, a menos que você tenha certeza de que deseja substituí-las. Você pode até obter algumas tags ID3v2 fora do processo (eu fiz em alguns testes, mas depende do que o iTunes decide fazer).
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