do you konw how i can get the alias of an with itunes converted music file. perhaps sth like this:
tell application “iTunes”
set a to selection
convert a
set convertedTrack to result
– that should be the converted track
location of convertedTrack
– that should be the location of the converted track
end tell
but this one isn’t running. i hope you have some ideas.
I hope this is the answer you are looking for. I found that you need a second tell statement to get the location of a coverted file inside of iTunes. Here is the script that works for me:
tell application "iTunes"
activate
display dialog "Convert Selected Track(s)" & ¬
return & return & ¬
"Are you ready?" buttons {"Cancel", "Yes"} default button 2
set the user_choice to the button returned of the result
if the user_choice is "Yes" then
-- get a list of track references
set these_tracks to the selection of browser window 1
if these_tracks is {} then error "No tracks are selected in the front window."
end if
set the track_count to the count of these_tracks
display dialog "Processing " & (track_count as string) & " tracks." & ¬
return & return & ¬
"This may take a minute. One moment." buttons {"¢"} default button 1 giving up after 3
set new_tracks to (convert these_tracks)
tell application "iTunes"
repeat with C_track in new_tracks
set track_location to (location of C_track)
add track_location to playlist "Testing" -- THIS WORKS!!!
end repeat
end tell
end tell
The part you might be looking for is in the second tell section, when you use the variable track_location to get the location of the C_track that was made in the first tell section. The track_location variable is complete; it has the exact location all the way from the Macintosh HD to the file itself.