Hello, I am so very new to this, I know I am way out of my league here.
I am trying to run this script continuously with out having to select a folder where the file is to be saved to.
Also, I want the next song to be selected after the script is ran, then for it to run again.
This was made by Doug Adams
I just want to tweak it a little…
tell application "iTunes"
if selection is not {} and (count items of selection) is 1 then
set theTrack to item 1 of selection
else
my alert_user_and_cancel("Please select one track punk.")
end if
if class of theTrack is not file track or artworks of theTrack is {} then
my alert_user_and_cancel("The selected track does not contain Artwork.")
end if
set artworkFolder to (choose folder with prompt ¬
"Where do you want to save Artwork?") as string
display dialog "Just a moment..." buttons {""} giving up after 1
try
set artworkData to (data of artwork 1 of theTrack) as picture
set artworkFormat to (format of artwork 1 of theTrack) as string
if artworkFormat contains "JPEG" then
set extension to ".jpg"
else if artworkFormat contains "PNG" then
set extension to ".png"
end if
set theName to (artist of theTrack & " - " & album of theTrack)
set tempartworkFile to (artworkFolder & "temp" & extension) as string
set finalartworkFile to (artworkFolder & theName & extension) as string
set file_reference to (open for access tempartworkFile write permission 1)
write artworkData starting at 0 to file_reference as picture
close access file_reference
do shell script "cd " & quoted form of (POSIX path of artworkFolder) & ¬
";tail -c+223 " & quoted form of ("temp" & extension) & "> " & ¬
quoted form of (theName & extension) & ";rm " & ¬
quoted form of ("temp" & extension)
(*
if frontmost then
if button returned of (display dialog ¬
"Artwork exported!" buttons {"Show File In Finder", "Thanks"} ¬
default button 2) is not "Thanks" then
tell application "Finder"
reveal file finalartworkFile
activate
end tell
end if
end if
*)
on error errM
close access file_reference
my alert_user_and_cancel("Unable to export Artwork from the selected track." & ¬
return & return & errM)
end try
end tell
to alert_user_and_cancel(message)
tell application "iTunes" to display dialog message buttons {"Cancel"} ¬
default button 1 with icon 0
end alert_user_and_cancel