Import in iTunes - Automator Workflow
Import in iTunes
It’s quite easy to add tracks to iTunes Library: drag them on iTunes window, or double-click if the tracks are already associated to iTunes.
But… what if we want to re-encode tracks, i.e. form an hig bitrate mp3 to a 128 AAC? Then we should import, convert, find out the original, delete it and its file, find out the copy…
This workflow can help: selected track files in Finder are directly encoded in iTunes according to current iTunes encoding preferences for import.
When conversion is over the user is prompted to change/set the artist and/or the album name (for all the tracks).
Installation
Just double click the workflow to install it.
You can also manually copy it to ~/Library/Services
Script source code
In case you prefer to create the workflow on yor own, here it is its source code.
on run {lista, parameters}
set tmax to (the number of items of lista) * 180
tell application "iTunes" to activate
with timeout of tmax seconds
tell application "iTunes" to set _ct to (convert lista)
end timeout
tell me to activate
tell application "iTunes" to set risp to (artist of (item 1 of _ct)) as text
set risp to (display dialog "Modify Artist?" default answer risp ¬
with icon note buttons {"Cancel", "Don't change", "Change"} default button 3)
if (the button returned of risp) is "Cancel" then return
if (the button returned of risp) is "Change" then
set risp to the text returned of risp
tell application "iTunes" to repeat with _t in _ct
set artist of _t to risp
end repeat
end if
tell application "iTunes" to set risp to (album of (item 1 of _ct)) as text
set risp to (display dialog "Modify Album?" default answer risp ¬
with icon note buttons {"Cancel", "Don't change", "Change"} default button 3)
if (the button returned of risp) is "Cancel" then return
if (the button returned of risp) is "Change" then
set risp to the text returned of risp
tell application "iTunes" to repeat with _t in _ct
set album of _t to risp
end repeat
end if
end run