<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: iTunes Javascripts</title>
	<atom:link href="http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/</link>
	<description>Random meanderings you're probably not interested in</description>
	<pubDate>Sat, 22 Nov 2008 02:47:19 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-beta3-9826</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6458</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Sat, 15 Nov 2008 16:09:53 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6458</guid>
		<description>I'm not even sure how exactly you could do that. iTunes does not know if a song is authorized or not until it tries to play it, and then it just asks for the password to the account.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not even sure how exactly you could do that. iTunes does not know if a song is authorized or not until it tries to play it, and then it just asks for the password to the account.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6457</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Sat, 15 Nov 2008 16:06:22 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6457</guid>
		<description>Hey Otto, Any chance of writing a script to locate unauthorized songs?</description>
		<content:encoded><![CDATA[<p>Hey Otto, Any chance of writing a script to locate unauthorized songs?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6357</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Mon, 27 Oct 2008 13:19:10 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6357</guid>
		<description>Look at the "Playlist" rule. Specifically, the "Playlist is not whatever".</description>
		<content:encoded><![CDATA[<p>Look at the &#8220;Playlist&#8221; rule. Specifically, the &#8220;Playlist is not whatever&#8221;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6356</link>
		<dc:creator>Ross</dc:creator>
		<pubDate>Mon, 27 Oct 2008 08:28:12 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6356</guid>
		<description>Thanks for the suggestion - I didn't know that Smart Playlists could do that. In fact I don't know how to do what you suggest! Could you give me an example? I don't know how to say "tracks not already in an existing playlist". I'm such a loser.
Thanks Ross</description>
		<content:encoded><![CDATA[<p>Thanks for the suggestion - I didn&#8217;t know that Smart Playlists could do that. In fact I don&#8217;t know how to do what you suggest! Could you give me an example? I don&#8217;t know how to say &#8220;tracks not already in an existing playlist&#8221;. I&#8217;m such a loser.<br />
Thanks Ross</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6354</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Sun, 26 Oct 2008 19:02:41 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6354</guid>
		<description>You can do that with Smart Playlists, no scripting needed. Just make a new rule on the playlist saying that the tracks can't be in the other playlist.</description>
		<content:encoded><![CDATA[<p>You can do that with Smart Playlists, no scripting needed. Just make a new rule on the playlist saying that the tracks can&#8217;t be in the other playlist.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6348</link>
		<dc:creator>Ross</dc:creator>
		<pubDate>Sun, 26 Oct 2008 08:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6348</guid>
		<description>Just discovered your scripts and I must say that your scripts are fantastic. So fantastic that I've decided too write one of my own but thought I'd ask you before I start, if what I want to do is possible. I don't want to waste time only to find out that it's impossible anyway. 
Say I have added 1000 tracks to my library today, and they are all still checked. I want to automatically create a series of playlists that contain a maximum of 99 randomly selected tracks each from those checked tracks. A track must only appear in one of the playlists, and not in any others.
I can get Smartlist to randomly select 99 tracks from the tracks added today, but if I make another playlist using the same criteria, I get a smattering of tracks that appear in the first playlist.  Am I wasting my time? Do you have any advice?

Cheers Ross</description>
		<content:encoded><![CDATA[<p>Just discovered your scripts and I must say that your scripts are fantastic. So fantastic that I&#8217;ve decided too write one of my own but thought I&#8217;d ask you before I start, if what I want to do is possible. I don&#8217;t want to waste time only to find out that it&#8217;s impossible anyway.<br />
Say I have added 1000 tracks to my library today, and they are all still checked. I want to automatically create a series of playlists that contain a maximum of 99 randomly selected tracks each from those checked tracks. A track must only appear in one of the playlists, and not in any others.<br />
I can get Smartlist to randomly select 99 tracks from the tracks added today, but if I make another playlist using the same criteria, I get a smattering of tracks that appear in the first playlist.  Am I wasting my time? Do you have any advice?</p>
<p>Cheers Ross</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6278</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Sun, 28 Sep 2008 15:23:29 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6278</guid>
		<description>I don't use Vista and have no idea what you're talking about in that regard.

On XP, reinstalling works and has worked for many people.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t use Vista and have no idea what you&#8217;re talking about in that regard.</p>
<p>On XP, reinstalling works and has worked for many people.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6276</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Sun, 28 Sep 2008 06:34:03 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6276</guid>
		<description>Sorry Otto but I have a different opinion.  I ran into the same problem as Ryan a where after upgrading to iTunes 8 the "NoArtwork" script was producing a “could not locate automation class named “itunes.application” error.
All I did to fix it was to to run an iTunes "Repair" on Vista's Programs &#38; Features. After this the script worked again.</description>
		<content:encoded><![CDATA[<p>Sorry Otto but I have a different opinion.  I ran into the same problem as Ryan a where after upgrading to iTunes 8 the &#8220;NoArtwork&#8221; script was producing a “could not locate automation class named “itunes.application” error.<br />
All I did to fix it was to to run an iTunes &#8220;Repair&#8221; on Vista&#8217;s Programs &amp; Features. After this the script worked again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Skates</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6272</link>
		<dc:creator>Skates</dc:creator>
		<pubDate>Thu, 18 Sep 2008 05:16:21 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6272</guid>
		<description>Same as the previous user Otto, I am getting Windows Scripting errors with the latest iTunes, iTunes 8.0.</description>
		<content:encoded><![CDATA[<p>Same as the previous user Otto, I am getting Windows Scripting errors with the latest iTunes, iTunes 8.0.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philippe Tadger</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6271</link>
		<dc:creator>Philippe Tadger</dc:creator>
		<pubDate>Sat, 13 Sep 2008 13:00:02 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6271</guid>
		<description>Otto thanks for your script work. I've Itunes 8. I've severals dead tracks on my ipod, but when i run your script, I recieve the messages "No dead tracks were found". Maybe it's not compatible with itunes 8 (also I update the software of my ipod). Thanks Indeed</description>
		<content:encoded><![CDATA[<p>Otto thanks for your script work. I&#8217;ve Itunes 8. I&#8217;ve severals dead tracks on my ipod, but when i run your script, I recieve the messages &#8220;No dead tracks were found&#8221;. Maybe it&#8217;s not compatible with itunes 8 (also I update the software of my ipod). Thanks Indeed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6270</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Mon, 08 Sep 2008 06:48:51 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6270</guid>
		<description>If you run one of these scripts from Windows, then it will run in wscript.exe, which has no interface at all. So no command window will normally pop up.</description>
		<content:encoded><![CDATA[<p>If you run one of these scripts from Windows, then it will run in wscript.exe, which has no interface at all. So no command window will normally pop up.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bovril</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6268</link>
		<dc:creator>Bovril</dc:creator>
		<pubDate>Thu, 04 Sep 2008 16:46:48 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6268</guid>
		<description>Thanks for this! I have been looking for something to do this for ages. Now I am no expert with all this scripting business, so I have some amateur questions. When I run should it open cmd and just do it's thing? Do I know when it's done or when I have added music and want to get lyrics what will happen?

Thanks again.</description>
		<content:encoded><![CDATA[<p>Thanks for this! I have been looking for something to do this for ages. Now I am no expert with all this scripting business, so I have some amateur questions. When I run should it open cmd and just do it&#8217;s thing? Do I know when it&#8217;s done or when I have added music and want to get lyrics what will happen?</p>
<p>Thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6028</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Mon, 28 Jul 2008 20:36:17 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6028</guid>
		<description>brendan: iTunes can do this itself. Just choose the "Consolidate Library" menu option. It'll move all your library files into the iTunes library folders and rename them according to their tags and everything.</description>
		<content:encoded><![CDATA[<p>brendan: iTunes can do this itself. Just choose the &#8220;Consolidate Library&#8221; menu option. It&#8217;ll move all your library files into the iTunes library folders and rename them according to their tags and everything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brendan</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6027</link>
		<dc:creator>brendan</dc:creator>
		<pubDate>Mon, 28 Jul 2008 20:29:08 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6027</guid>
		<description>Hey otto,
My music is currently stored in a stupidly named folder as I was only testing out iTunes at first. One thing led to another and I'd spent hours and hours getting all the tags perfect with all artwork showing nicely.
Now I want to move or just rename the folder but with iTunes being an Apple product it's not so straight forward.
I have the database moved over to a sensible location and artwork/metadata intact but of course now it can't find my music in it's new location.

I was wondering if it's possible to modify the RemoveDeadTracks script to update the location path, so something like this:
if (currTrack.Location == "d:\Music\blah*")
		{
currTrack.Location = "new path"

		}

Is something like that possible?
Thanks</description>
		<content:encoded><![CDATA[<p>Hey otto,<br />
My music is currently stored in a stupidly named folder as I was only testing out iTunes at first. One thing led to another and I&#8217;d spent hours and hours getting all the tags perfect with all artwork showing nicely.<br />
Now I want to move or just rename the folder but with iTunes being an Apple product it&#8217;s not so straight forward.<br />
I have the database moved over to a sensible location and artwork/metadata intact but of course now it can&#8217;t find my music in it&#8217;s new location.</p>
<p>I was wondering if it&#8217;s possible to modify the RemoveDeadTracks script to update the location path, so something like this:<br />
if (currTrack.Location == &#8220;d:\Music\blah*&#8221;)<br />
		{<br />
currTrack.Location = &#8220;new path&#8221;</p>
<p>		}</p>
<p>Is something like that possible?<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BorgSPeon</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6017</link>
		<dc:creator>BorgSPeon</dc:creator>
		<pubDate>Fri, 25 Jul 2008 01:00:07 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-6017</guid>
		<description>Do you have a script that will allow you to put a group of files (mp3s) into the podcast directory without subscribing to an rss feed?</description>
		<content:encoded><![CDATA[<p>Do you have a script that will allow you to put a group of files (mp3s) into the podcast directory without subscribing to an rss feed?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5995</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Mon, 14 Jul 2008 15:56:57 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5995</guid>
		<description>Ryan, Nik: You cannot "get around" those errors. The error basically means that iTunes is not installed properly. Try reinstalling iTunes.</description>
		<content:encoded><![CDATA[<p>Ryan, Nik: You cannot &#8220;get around&#8221; those errors. The error basically means that iTunes is not installed properly. Try reinstalling iTunes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5994</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Sun, 13 Jul 2008 23:59:27 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5994</guid>
		<description>I used your scripts on an XP machine with itunes 7.7 and it worked perfect!

BUT I have my main machine running Vista and it does not work.  Do you know how I can edit the code to get around this:
"could not locate automation class named "itunes.application"

Have you found a fix for Vista?</description>
		<content:encoded><![CDATA[<p>I used your scripts on an XP machine with itunes 7.7 and it worked perfect!</p>
<p>BUT I have my main machine running Vista and it does not work.  Do you know how I can edit the code to get around this:<br />
&#8220;could not locate automation class named &#8220;itunes.application&#8221;</p>
<p>Have you found a fix for Vista?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nik</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5993</link>
		<dc:creator>Nik</dc:creator>
		<pubDate>Sun, 13 Jul 2008 22:00:44 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5993</guid>
		<description>Do you know if they changed things in the latest iTunes 7.7?  I had "borrowed" on of your scripts for loading TV shows to iTunes via a batch script.  Everything was working great and now I get and error (after upgrading itunes) which says "library not registered".  I have the following two lines in the script.

var	ItunesApp = WScript.CreateObject("iTunes.Application");
var	mainLibrary = ItunesApp.LibraryPlaylist;

I don't know much or anything about jscript so I'm looking for help from resources I've found in piecing together the script that was once working.

Thanks ... any help would be appreciated.</description>
		<content:encoded><![CDATA[<p>Do you know if they changed things in the latest iTunes 7.7?  I had &#8220;borrowed&#8221; on of your scripts for loading TV shows to iTunes via a batch script.  Everything was working great and now I get and error (after upgrading itunes) which says &#8220;library not registered&#8221;.  I have the following two lines in the script.</p>
<p>var	ItunesApp = WScript.CreateObject(&#8221;iTunes.Application&#8221;);<br />
var	mainLibrary = ItunesApp.LibraryPlaylist;</p>
<p>I don&#8217;t know much or anything about jscript so I&#8217;m looking for help from resources I&#8217;ve found in piecing together the script that was once working.</p>
<p>Thanks &#8230; any help would be appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prod</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5978</link>
		<dc:creator>Prod</dc:creator>
		<pubDate>Sat, 05 Jul 2008 01:23:26 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5978</guid>
		<description>Hi. I'm very new when it comes to all of this and i've been running AtomicParsley to edit specific tags which you normally can't accomplish in editing within iTunes itself. The only one left for me is to edit/add LongDescription for my movies in iTunes. I've looked everywhere and i can't find a solution. I downloaded iTunes COM Windows SDK but have no idea how to handle it or how to write those jscripts to edit the longDescriptions which i've desperately been trying to achieve. If anyone can write this script for me or at least give me the tutorial on how to accomplish this then please i beg of you to help me. You can contact me by e-mail aswell (cesar_belifs@hotmail.com). I've really been trying to find these answers for 2 whole days now 24/7 with no luck at all...i'm using Windows XP. The short description i've accomplished which can be edited with AtomicParsley but to edit the long description is a no go for me, the one you can read when you click on the (i) button on the description field on itunes. Please help me on this one. I'de be most thankful for it!</description>
		<content:encoded><![CDATA[<p>Hi. I&#8217;m very new when it comes to all of this and i&#8217;ve been running AtomicParsley to edit specific tags which you normally can&#8217;t accomplish in editing within iTunes itself. The only one left for me is to edit/add LongDescription for my movies in iTunes. I&#8217;ve looked everywhere and i can&#8217;t find a solution. I downloaded iTunes COM Windows SDK but have no idea how to handle it or how to write those jscripts to edit the longDescriptions which i&#8217;ve desperately been trying to achieve. If anyone can write this script for me or at least give me the tutorial on how to accomplish this then please i beg of you to help me. You can contact me by e-mail aswell (cesar_belifs@hotmail.com). I&#8217;ve really been trying to find these answers for 2 whole days now 24/7 with no luck at all&#8230;i&#8217;m using Windows XP. The short description i&#8217;ve accomplished which can be edited with AtomicParsley but to edit the long description is a no go for me, the one you can read when you click on the (i) button on the description field on itunes. Please help me on this one. I&#8217;de be most thankful for it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5938</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Fri, 13 Jun 2008 10:48:28 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5938</guid>
		<description>If there is a way to do it, then I don't know what it is.

Reinstalling iTunes has always fixed it in all the cases I've seen.</description>
		<content:encoded><![CDATA[<p>If there is a way to do it, then I don&#8217;t know what it is.</p>
<p>Reinstalling iTunes has always fixed it in all the cases I&#8217;ve seen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tinman</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5935</link>
		<dc:creator>tinman</dc:creator>
		<pubDate>Fri, 13 Jun 2008 00:26:12 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5935</guid>
		<description>so is there no way to register the automation class manually?
(sorry if that's a stupid question)

otherwise.. I guess I have to pray that the next version of itunes (which shouldn't be far), will fix it.. but I don't have high hopes!</description>
		<content:encoded><![CDATA[<p>so is there no way to register the automation class manually?<br />
(sorry if that&#8217;s a stupid question)</p>
<p>otherwise.. I guess I have to pray that the next version of itunes (which shouldn&#8217;t be far), will fix it.. but I don&#8217;t have high hopes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5932</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Wed, 11 Jun 2008 13:45:18 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5932</guid>
		<description>tinman: That problem only has one cause and one solution. The cause is an incomplete iTunes installation. The solution is a complete removal and reinstall of iTunes. Sometimes you can get it working by simply installing iTunes over itself.

However, since you've tried that already, you're probably out of luck, because that is the only answer to your problem.</description>
		<content:encoded><![CDATA[<p>tinman: That problem only has one cause and one solution. The cause is an incomplete iTunes installation. The solution is a complete removal and reinstall of iTunes. Sometimes you can get it working by simply installing iTunes over itself.</p>
<p>However, since you&#8217;ve tried that already, you&#8217;re probably out of luck, because that is the only answer to your problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tinman</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5930</link>
		<dc:creator>tinman</dc:creator>
		<pubDate>Wed, 11 Jun 2008 11:34:52 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5930</guid>
		<description>has any one come across this error that billox mentions above?
“WScript.CreateObject - Could not locate automation class named iTunes.Application”. Error code: 80020009.

I am also getting this and have tried uninstalling and resintalling numerous times (even older versions) but it has not fixed...
I wrote some scripts which makes itunes useful for me, but with them not working it's completely useless.

:(
Dale.</description>
		<content:encoded><![CDATA[<p>has any one come across this error that billox mentions above?<br />
“WScript.CreateObject - Could not locate automation class named iTunes.Application”. Error code: 80020009.</p>
<p>I am also getting this and have tried uninstalling and resintalling numerous times (even older versions) but it has not fixed&#8230;<br />
I wrote some scripts which makes itunes useful for me, but with them not working it&#8217;s completely useless.</p>
<p> <img src='http://ottodestruct.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
Dale.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5927</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Tue, 10 Jun 2008 15:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5927</guid>
		<description>I have just used your "one hit wonders" script.  Fantastic.  It does exactly what it says on the tin.  Thank you.</description>
		<content:encoded><![CDATA[<p>I have just used your &#8220;one hit wonders&#8221; script.  Fantastic.  It does exactly what it says on the tin.  Thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Otto</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5925</link>
		<dc:creator>Otto</dc:creator>
		<pubDate>Sun, 08 Jun 2008 14:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5925</guid>
		<description>aldo: The evil lyrics script is not needed anymore, the evillyrics program now supports talking to iTunes directly. Use that.</description>
		<content:encoded><![CDATA[<p>aldo: The evil lyrics script is not needed anymore, the evillyrics program now supports talking to iTunes directly. Use that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aldo</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5924</link>
		<dc:creator>aldo</dc:creator>
		<pubDate>Sun, 08 Jun 2008 13:30:52 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5924</guid>
		<description>evillyrics js..

seems to work only for some songs. i downloaded a night of lyrics with evillyrics and 
then run the script to automatically write the lyrics into the tag. only 22 song over 
3 hundreds. ..even if the updateall is set to true.
what can i do to make the script running?</description>
		<content:encoded><![CDATA[<p>evillyrics js..</p>
<p>seems to work only for some songs. i downloaded a night of lyrics with evillyrics and<br />
then run the script to automatically write the lyrics into the tag. only 22 song over<br />
3 hundreds. ..even if the updateall is set to true.<br />
what can i do to make the script running?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dale</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5760</link>
		<dc:creator>Dale</dc:creator>
		<pubDate>Thu, 10 Apr 2008 15:09:56 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-5760</guid>
		<description>I am just wondering if you have ever successfully added file/track thru the iTunes COM/Script to iPod Shuffle?
 
From iTunes SDK, there is AddFile() function to the LibraryPlaylist out of iPod source. It works for most of iPod devices, but to iPod Shuffle, AddFile() function will return 0xA0040203 (ITUNES_E_OBJECTLOCKED)!

Any idea about this?
Or do you know of any other function such as "Autofill" for iPod Shuffle?
Thanks.</description>
		<content:encoded><![CDATA[<p>I am just wondering if you have ever successfully added file/track thru the iTunes COM/Script to iPod Shuffle?</p>
<p>From iTunes SDK, there is AddFile() function to the LibraryPlaylist out of iPod source. It works for most of iPod devices, but to iPod Shuffle, AddFile() function will return 0xA0040203 (ITUNES_E_OBJECTLOCKED)!</p>
<p>Any idea about this?<br />
Or do you know of any other function such as &#8220;Autofill&#8221; for iPod Shuffle?<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: billox</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-4923</link>
		<dc:creator>billox</dc:creator>
		<pubDate>Sun, 30 Mar 2008 17:04:56 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-4923</guid>
		<description>Hi Otto.
When I run your script, I got this error: "WScript.CreateObject - Could not locate automation class named iTunes.Application". Error code: 80020009.

I use iTunes 7.6.1 and Win Xp2. In my registry do not exist the Class iTunes.Application. In regedit (HKCR), I found: IpodManager Class, ItunesDevices Class, ItunesService Class, ServiceDiagnostics Class and iPodUpdaterInterface Class.

Any ideas? Thanks.</description>
		<content:encoded><![CDATA[<p>Hi Otto.<br />
When I run your script, I got this error: &#8220;WScript.CreateObject - Could not locate automation class named iTunes.Application&#8221;. Error code: 80020009.</p>
<p>I use iTunes 7.6.1 and Win Xp2. In my registry do not exist the Class iTunes.Application. In regedit (HKCR), I found: IpodManager Class, ItunesDevices Class, ItunesService Class, ServiceDiagnostics Class and iPodUpdaterInterface Class.</p>
<p>Any ideas? Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anders</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-4781</link>
		<dc:creator>Anders</dc:creator>
		<pubDate>Thu, 20 Mar 2008 19:06:55 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-4781</guid>
		<description>Hi Otto.

Is it possible to write a script that increases the playcount.

It's a feature that I'd like to use together with my Serato Scratch Live DJ-software.

I'd want the playcount to increase when I play the track in SSL.

Thanx
/Anders</description>
		<content:encoded><![CDATA[<p>Hi Otto.</p>
<p>Is it possible to write a script that increases the playcount.</p>
<p>It&#8217;s a feature that I&#8217;d like to use together with my Serato Scratch Live DJ-software.</p>
<p>I&#8217;d want the playcount to increase when I play the track in SSL.</p>
<p>Thanx<br />
/Anders</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nik</title>
		<link>http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-4771</link>
		<dc:creator>nik</dc:creator>
		<pubDate>Sat, 15 Mar 2008 20:45:51 +0000</pubDate>
		<guid isPermaLink="false">http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/#comment-4771</guid>
		<description>Otto... I'm trying to hack a script together that allows me to add tv shows (.mp4) into my playlist.  I currently have the scipt working to with basic attributes but I want the script to check to see if the file I'm trying to add is already in iTunes.
I need JScript help since the last time I coded was using "C and c++" back in the day.  

I'm getting a runtime error when it tries so search a collection when it can't find anthing in the library already. So the first issue is:  When a collection is blank as the result of a search is there a way to determine that before the code fails when using the enumerate statement?

Second issue I'm having is when it has a valid collection,and I try to verify duplicates, it always matches even though the echo statement shows them not matching.

Here's the script:
/* 
    addToiTunes.js  [video type: 0=music 1=movie 2=musicvideo 3=tv show] [Show] [Title] [AirDateTime]
*/ 


var	ItunesApp = WScript.CreateObject("iTunes.Application");
var	mainLibrary = ItunesApp.LibraryPlaylist;

var file;
var videoKind;
var show;
var title;
var emumItems;
 

if(WScript.Arguments.length &#62; 0)
{
    file = WScript.Arguments(0);
}
    
if(WScript.Arguments.length &#62; 1)
{
    videoKind = WScript.Arguments(1); 
}

if(WScript.Arguments.length &#62; 2)
{
    show = WScript.Arguments(2);
}                   

if(WScript.Arguments.length &#62; 3)
{
    title = WScript.Arguments(3); 
}

if(WScript.Arguments.length &#62; 4)
{
    epid = WScript.Arguments(4); 
    if (title=="") {title=epid;} 
} //fix for null mediacenter episode titles, use AirDateTime
  
 WScript.Echo ("Before collection search", show, videoKind, title);

var colItems = mainLibrary.Search(show, 0);  


if (file) 
{
   enumItems = new Enumerator(colItems);    

   for (; !enumItems.atEnd(); enumItems.moveNext()) 
   {
      var objItem = enumItems.item(); 	
      WScript.Echo ("For Loop");
      WScript.Echo (objItem.name, '****', title);
      WScript.Echo (objItem.show, show);

      if (title = (objItem.name)) 
      {
         WScript.Echo ("Matching show already in Library - don't Add it");
      }
      else 
      {
	 WScript.Echo ("Add to Library");

 	 var opStatus = mainLibrary.AddFile(file);
	 while (opStatus.InProgress){}               //wait until done
         track = opStatus.Tracks.Item(1);            //quick and dirty
         if (videoKind)
         {
	    track.videoKind=videoKind; 
	 }
         if (show)
	 {	
	    track.Show=show; 
         }
         if (title)
         {
	    track.Name=title; 
         }
         if (epid)
         {
	    track.episodeid=epid; 
         } 

      }         
   }               
}</description>
		<content:encoded><![CDATA[<p>Otto&#8230; I&#8217;m trying to hack a script together that allows me to add tv shows (.mp4) into my playlist.  I currently have the scipt working to with basic attributes but I want the script to check to see if the file I&#8217;m trying to add is already in iTunes.<br />
I need JScript help since the last time I coded was using &#8220;C and c++&#8221; back in the day.  </p>
<p>I&#8217;m getting a runtime error when it tries so search a collection when it can&#8217;t find anthing in the library already. So the first issue is:  When a collection is blank as the result of a search is there a way to determine that before the code fails when using the enumerate statement?</p>
<p>Second issue I&#8217;m having is when it has a valid collection,and I try to verify duplicates, it always matches even though the echo statement shows them not matching.</p>
<p>Here&#8217;s the script:<br />
/*<br />
    addToiTunes.js  [video type: 0=music 1=movie 2=musicvideo 3=tv show] [Show] [Title] [AirDateTime]<br />
*/ </p>
<p>var	ItunesApp = WScript.CreateObject(&#8221;iTunes.Application&#8221;);<br />
var	mainLibrary = ItunesApp.LibraryPlaylist;</p>
<p>var file;<br />
var videoKind;<br />
var show;<br />
var title;<br />
var emumItems;</p>
<p>if(WScript.Arguments.length &gt; 0)<br />
{<br />
    file = WScript.Arguments(0);<br />
}</p>
<p>if(WScript.Arguments.length &gt; 1)<br />
{<br />
    videoKind = WScript.Arguments(1);<br />
}</p>
<p>if(WScript.Arguments.length &gt; 2)<br />
{<br />
    show = WScript.Arguments(2);<br />
}                   </p>
<p>if(WScript.Arguments.length &gt; 3)<br />
{<br />
    title = WScript.Arguments(3);<br />
}</p>
<p>if(WScript.Arguments.length &gt; 4)<br />
{<br />
    epid = WScript.Arguments(4);<br />
    if (title==&#8221;") {title=epid;}<br />
} //fix for null mediacenter episode titles, use AirDateTime</p>
<p> WScript.Echo (&#8221;Before collection search&#8221;, show, videoKind, title);</p>
<p>var colItems = mainLibrary.Search(show, 0);  </p>
<p>if (file)<br />
{<br />
   enumItems = new Enumerator(colItems);    </p>
<p>   for (; !enumItems.atEnd(); enumItems.moveNext())<br />
   {<br />
      var objItem = enumItems.item();<br />
      WScript.Echo (&#8221;For Loop&#8221;);<br />
      WScript.Echo (objItem.name, &#8216;****&#8217;, title);<br />
      WScript.Echo (objItem.show, show);</p>
<p>      if (title = (objItem.name))<br />
      {<br />
         WScript.Echo (&#8221;Matching show already in Library - don&#8217;t Add it&#8221;);<br />
      }<br />
      else<br />
      {<br />
	 WScript.Echo (&#8221;Add to Library&#8221;);</p>
<p> 	 var opStatus = mainLibrary.AddFile(file);<br />
	 while (opStatus.InProgress){}               //wait until done<br />
         track = opStatus.Tracks.Item(1);            //quick and dirty<br />
         if (videoKind)<br />
         {<br />
	    track.videoKind=videoKind;<br />
	 }<br />
         if (show)<br />
	 {<br />
	    track.Show=show;<br />
         }<br />
         if (title)<br />
         {<br />
	    track.Name=title;<br />
         }<br />
         if (epid)<br />
         {<br />
	    track.episodeid=epid;<br />
         } </p>
<p>      }<br />
   }<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
