Embed MP3 Album Artwork from iTunes for Windows
So I was transferring several of my mp3 files onto my phone to be able to have them to play anywhere when I realized all the album artwork that shows up in iTunes doesn’t seem to be copying over with the mp3’s. So I began to poke around on the internet and I continually was finding the AppleScript: http://dougscripts.com/itunes/scripts/ss.php?sp=embedart
This wasn’t at all helpful to me though, because I run a PC and can’t exactly run that script. After wasting too much time with countless id3 tag editors in hope they would have a feature like this, I managed to stumble across a site by someone called Teridon who had written a VBScript, a Perl script and a exe that all worked with iTunes 6-9. Unfortunately for me I just upgraded to version 10. So i downloaded the VBScript and just glanced at the code to see if there was some reason it would work with iTunes 10. After just modifying the check to see if your version of iTunes was 7 to a 10, Voila! it worked flawlessly!
Here’s the modified VBScript I used: iTunes.vbs
(Right click or option-click the link and choose “Save As…” to download this file.)
Thanks to JRSousa2 for the error checking fix!
Make sure to open a run window by choosing “Run” from the start menu and then typing “cscript PATH.TO.THE.FILEitunes.vbs” obviously replace PATH.TO.THE.FILE with the path to where you downloaded the script. To make it super simple just download it to the root of the C drive.
Next it will pop up a menu with all your playlists. It should read something like this:
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.
Select from the following playlists
Number of playlists: 11
1: Library
2: Music
3: Movies
4: TV Shows
5: Genius
6: iTunes DJ
7: My Top Rated
8: Recently Added
9: Recently Played
10: Unrated Songs
11: Z Testing Ones
Enter comma-separated lists to process:
Simple type the number of the corresponding playlist you want it to run on and hit enter. Now sit back and wait. It does take it some time, but I did it on my library right before I went to sleep and woke up to a complete library and mp3’s with embedded artwork. I ran it first on some test files, hence the playlist named “Z Testing Ones” so I could ensure it wouldn’t break anything and it still worked. I would recommend the same before you run it on your whole music library. But after a few tests, I noticed no problems and ran it on the whole library.
The original file came from Teridon. I only modified one line of code to allow it to work on iTunes 10. If you want to check out his code or if you have iTunes 6-9 I would go here: http://mysite.verizon.net/teridon/itunesscripts/ and download the original. If you have any questions feel free to post them.
Hey Mate… tried your modified script and i keep getting error in line 67 “ActiveX Component can’t create object”
Error Code 800A01AD
Please Advise
Thanks in advance
Mr Furious
I fixed a bug in this script for use with iTunes 11.
Contact me to get a copy.
LINK REMOVED
I sent you an email or feel free to reply here via another comment. The one bug I noticed since I first wrote this would be to simply comment out the version checking entirely, but if there is another bug please let me know too!
Thanks for the fix! I just got your email and posted the changes to the script.
Hello John,
after processing some files I get the following error:
itunes,vbs(136, 7) : The artwork has been deleted
I use Itunes 10.5.2.11 (german).
Thanks for your support.
I haven’t run into this error myself, but I will try to look back at the script and see if I can spot what is causing this. I’ll let you know if I find anything and I’ll post any updated script back on this page.
Hey John
i got the same error as Mario
it stops after a few files giving that error
what i did realize was that whichever song it stopped at, the following songs on itunes’ artworks were cleared, so had to redownload. then the script worked for 2 more songs of the same album and it closed.
error goes like:
itunes,vbs(136, 7) : The artwork has been deleted
I think JRSousa2 sent me the fix to you, Mario’s and maybe even Mr Furious’ problem. Try downloading and running the script again with his fix put in place this time. It should skip any songs it has errors on and still work for the rest.
Let me know if you have any troubles and be sure to thank jr up above if this solves your problem!
Thanks for the fix but it doesn’t work. Another error this time:
itunes.vbs(173, 6): Kompilierungsfehler in Microsoft VBScript: Nicht erwartet: ‘Next’
I try to translate the message:
itunes.vbs(173, 6): Compilation Error in Microsoft VBScript: Unexpected: ‘Next’
I think i spotted a missing End If and added that. Let me know what happens now.
Sorry for the trial and error method here, I stop using iTunes recently so I can’t test it fully. If I get a chance I will re-install iTunes to give this some more thorough testing.
Hey John,
bad news…
itunes.vbs(139, 7) : The artwork has been deleted
Mario, I will try to get some time this weekend and re-install iTunes to see if I can re-create your error your getting and see what is going wrong.
I’ll keep you posted once I can find out more.
So just to be clear do you run the following command: “cscript C:\itunes.vbs” assuming you put it in your root folder? When I do this a command prompt window just opens and closes quickly. If I open ‘cmd’ and navigate to C:\ and run “cscript itunes.vbs” I get the following:
C:\itunes.vbs(70, 1) Microsoft VBScript runtime error: ActiveX component can’t create object: ‘iTunes.Application.1’
If I run the command “cscript C:\itunes.vbs” the cmd windows opens showing my itunes playlist. When I enter the number of the playlist to be processed the window closes.
If I run the script directly from a command line in the cmd window, I get the error itunes.vbs(139, 7) : The artwork has been deleted after entering the number of the playlist
I only am able to get this error when iTunes is not installed. I also believe you need to have iTunes running to get this to work properly.
If neither of these works, it may take uninstalling iTunes and re-installing to get the COM interface to start working again properly.
Just tried it on another PC with a fresh itunes installation (10.6.3.25) and application already running
itunes.vbs(141, 8): Microsoft VBScript runtime error: Variable is undefined: ‘IsDownlArtw_value’
Sorry Mario, that reply was directed at the error: ActiveX component can’t create object: ‘iTunes.Application.1′
Your error I still have yet to figure out what it is doing.
I have just tried this tool for the first time and I encountered the same error (running iTunes 10.2.1.1).
I believe it stems from the variable not being initialized. Open the script in notepad and at the beginning of the file add a line “Dim IsDownlArtw_value”. There are many of these Dim lines so it is pretty obvious where to put it.
I encountered two other uninitialized variables (erro_no and erro_desc).
After adding the equivalent additional lines, the program seems to work perfectly!
This is exactly what I was looking for!
Sorry I didn’t even realize I missed that. I added in the the extra lines of code to declare the new variables. Thanks for catching that!
Mario, you should give it a try now and see if it works any better.
Same error:
itunes.vbs(139, 7) : The artwork has been deleted
C:\itunes.vbs(142, 7) (null): The artwork has been deleted.
Please, please fix this! I came here after failing in so many attempts and it worked fine on the test playlist, but not on the music library.
Or you could add an exception handler that ingnores that track on which this error happens and moves on to the next. That would do just fine!
Hi John
I fixed the “itunes.vbs(142, 7) (null): The artwork has been deleted.” error to the extent that for the files this error appears, the script doesn’t embed the artwork to the tag and moves on to the next file.
I saw you tried to do exactly the same and it didn’t work out because the error occurs before line 142 and not at line 142. Just add
“On Error Resume Next”
after
“Set Art = Artobj.Item(c)”
and it works like a charm.
Mario and Wayne, I think this will solve your problem as well.
Cheers!
Thanks for all the help with this script. I have been pretty busy lately and haven’t had enough time to figure this out. I added your suggestion and uploaded it so now it should bypass any errors as they pop up.
Hey, I can’t seem to get this to work, does it work with 10.6?
the script runs but instead of embedding the artwork itunes finds, it removes it.
I can get the artwork back through itunes “get album art” but the script just doesn’t want to embed it no matter how many times i try.
any suggestions?
Forgot to mention, it has embedded some of the art. Just not all of them even though itunes finds art (about 50 albums)
It worked for a while and fixed some files, and then the window just closes. I can see that something is written, but the window closes too fast to see what. Any way to fix it?
So happy I found this page. I had an old script that just stopped working and I was worried no one would ever maintain it. Thanks so much to John and others on here for your hard work!
Thanks so much for acknowledging my fix, man.
Any plans to fix it for iTunes 11? (I see comment about iTunes 11 but they looks like they are posted like 100 days ago… and iTunes 11 didn’t exits then.)
Sorry I haven’t touched this script much since I stopped using iTunes myself. But for your fix you should just be able to download the script file and find the following line:
Reg1.Pattern = "^10"
And replace it with:
Reg1.Pattern = "^11"
thanks… that worked. This is the best and only way to fix issues with itunes match and album art!
Running Windows XP (still!). I edited the script to replace the
Reg1.Pattern = “^10”
with
Reg1.Pattern = “^11”
But, when I run it it just flashes up a window for about a tenth of a second, then nothing. The same as before I edited the script.
I have tried it both with iTunes open, and with it closed with no difference.
Any ideas?
By the way, thanks for working on this script…it’s hard to believe one has to resort to this, for what should be a basic capability of iTunes.
Thanks for this script and the fix for version 11.
try this:
http://code.google.com/p/itsfv/
its a great tool to manage your files in itunes!
When I run the script, it just says “0 files processed”, closes, and nothing else happens. I have the album artwork of every album.
Run iTunes as Administrator (right click the icon, select “Run as Administrator”) to fix the “ActiveX component can’t create object: ‘iTunes.Application.1′” problem.
CAN YOU PLEASE REMOVE MY FB LINK FROM HERE?
IT WAS SUCH A STUPID IDEA, PLEASE REMOVE IT GUYS.
I HAVE CREATED SOME OTHER SCRIPTS THAT MIGHT BE NICE FOR YOU. ONE OF THEM LOADS THE INFO ABOUT THE SONGS IN A PLAYLISTS TO AN EXCEL WORKBOOK.
No problem, I removed all the links. If you want to post any links to the other scripts feel free to put them in the comments.
thanks sooo much this worked so well
[…] http://sheerboredom.net/…/ […]
[…] is a thread here Embed artwork in all tracks of an album (you probably also want to see: Sheer Boredom | Embed MP3 Album Artwork from iTunes for Windows) that goes through the process of using scripts to embed iTunes artwork into your songs. Windows […]
Hi John,
really hope that you read this comment even though the post is so old! first of all thanks for your effort and the others who also helped!
Is the script in your link already with all the changes? I tried it and changed the iTunes version line as you guys described it. Is the Microsoft Windows Based Script Host the right execution tool? I don’t have a clue about that topic sorry :/ When I start your script with that I get a window with the command “select from the following playlist” and I can only hit an “ok” button. This repeats just with the different names of my playlists. I always click “ok” and then I end up with an error message saying:
Line: 115
character: 3
error: The handle is invalid
Code: 80070006
Source: (zero)
I tried to use this script on Windows 7 with iTunes 11.2.2.3.
I’m also having this issue, and I know just about as much about visual basic. If anyone one could help that’d be great
Hi, are you still having issues with the artwork? Because all i did to fix it was
1. Close itunes as it is
2. Go to Itunes Folder and move Itunes Library and Itunes Music Library to a different Location
3. Open Itunes
4. Select Import Playlist and look for the Itunes Music Library file you moved before.
This will work as reading all the music again, and all the information remains just as it is.
?
Nothing is wrong with my music, I just can’t get the script to work
Thanks! I’ve just updated the script to work with iTunes 12, this has saved me hours of work.