<?xml version="1.0"?>
<!DOCTYPE content [ <!ENTITY nbsp " "> ]>
<rdf:RDF xml:base="http://snarfed.org/rdf"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:dc="http://purl.org/dc/elements/1.1/">

<rdf:Description rdf:about="http://snarfed.org">
  <dc:title> snarfed.org  </dc:title>
  <dc:description> draw group stream of consciousness </dc:description>
  <dc:creator> Ryan Barrett &lt;snarfed at ryanb dot org&gt; </dc:creator>
  <dc:language> en </dc:language>
  <dc:format> text/html </dc:format>
  <dc:rights> Copyright 2002-2007 Ryan Barrett </dc:rights>
</rdf:Description>

<rdf:Description rdf:about="http://snarfed.org/space/windows%20itunes%20script%20to%20unset%20skip%20when%20shuffling">
  <dc:title> iTunes for Windows script to unset <i>Skip when shuffling</i> </dc:title>
  <dc:creator> Ryan Barrett &lt;snarfed at ryanb dot org&gt; </dc:creator>
  <dc:date> 2007-04-08T04:01:00Z </dc:date>
  <dc:language> en </dc:language>
  <dc:format> text/html </dc:format>
  <dc:rights> Copyright 2002-2007 Ryan Barrett </dc:rights>

  <content>
    <p><a href="http://apple.com/itunes/"><img src="/space/itunes.jpg" alt="iTunes" title="" /></a>
<a href="http://apple.com/ipodshuffle/"><img src="/space/ipod_shuffle.jpg" alt="iPod Shuffle" title="" /></a>
<a href="http://en.wikipedia.org/wiki/Podcast"><img src="/space/rss.jpg" alt="Podcast" title="" /></a></p>

<p><a href="/space/no_skip_when_shuffling.js">no_skip_when_shuffling.js</a> is a script for
<a href="http://apple.com/itunes/">iTunes</a> for Windows that unsets the
<a href="http://www.reelsmart.com/2006/01/28/itunes-tip-29-skip-tracks-when-shuffling/"><em>skip when shuffling</em></a>
setting on all songs in a playlist. It was inspired by <a href="http://www.macosxhints.com/article.php?story=20070218041737189">an
AppleScript</a>
which does the same thing for iTunes on Mac OS X.</p>

<p><em>Skip when shuffling</em> prevents songs and podcasts from playing nice with the
iPod Shuffle. It won't play them when in shuffle mode, and more importantly,
<a href="http://www.apple.com/ipodshuffle/sync.html">Autofill</a> won't see them at all.
Worse, iTunes sets <em>skip when shuffling</em> by default on new podcasts when
they're downloaded. This script provides a workaround.</p>

<p>I have a <a href="http://docs.info.apple.com/article.html?artnum=93139">Smart Playlist</a>
for the podcasts I haven't listened to yet. Every morning, I update my
podcasts, then run this script. When I plug in my iPod, Autofill syncs it so
that it has only the podcasts I haven't listened to yet.</p>

<p>You can <a href="/space/no_skip_when_shuffling.js">download the script</a>, or copy and
paste it from here:</p>

<div class='p-shadow'><pre><code>var playlist_name = "Podcasts";

var iTunes = WScript.CreateObject("iTunes.Application");
var sources = iTunes.Sources;
var playlists = sources.ItemByName("Library").Playlists;
var playlist = playlists.ItemByName(playlist_name);
var tracks = playlist.Tracks;

for (i = 1; i &lt;= tracks.Count; i++) {
    tracks.Item(i).ExcludeFromShuffle = false;
}
</code></pre></div>

<p><br class='clearing' />Set <code>playlist_name</code> to the name of the playlist you want it to change. Then,
make sure the file's extension in Windows is <code>.js</code>, and double-click on
it. It should be run by
<a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/wsh_overview.mspx">Windows Script
Host</a>
(<a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/wsh_runfromwindowsbasedhost.mspx?mfr=true">wscript.exe</a>).
If it's not, change the File Type for <code>.js</code> files in Explorer's Folder
Options.</p>

<p>This script uses the <a href="http://developer.apple.com/sdk/itunescomsdk.html">iTunes COM SDK for
Windows</a>. That page has since
disappeared, so I used a
<a href="http://www.microsoft.com/technet/scriptcenter/funzone/tunes.mspx">Microsoft TechNet article on scripting
iTunes</a> -
Microsoft, weird, I know, but the article was invaluable. You can also still
find <code>iTunesCOMInterface.h</code> on <a href="http://www.google.com/codesearch?hl=en&amp;q=+iTunesCOMInterface.h+show:tuaQ8-JRruc:VCewQzHOoTs:OeYmnRoCpzg&amp;sa=N&amp;cd=3&amp;ct=rc&amp;cs_p=svn://svn.berlios.de/mgoodies/trunk&amp;cs_f=listeningto/players/iTunesCOMInterface.h#a0">Google Code
Search</a>,
among others. Finally, <a href="http://blog.nogo.se/2007/01/17/scripting-itunes-making-an-alarm-clock/">RipperDoc's
tutorial</a>
was helpful, as were
<a href="http://ottodestruct.com/blog/2005/10/20/itunes-javascripts/">Otto's</a> and
<a href="http://dougscripts.com/itunes/itinfo/windowshelp.php">Doug's</a> collections of
scripts.</p>

  </content>

  <rdf:Seq>

<rdf:li>
<rdf:Description rdf:about="#1192901487.04">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> iTunes for Windows script to unset <i>Skip when shuffling</i> </dc:title>
  <dc:creator> Brian </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    Outstanding!!&nbsp; <br />
<br />
This is the best solution I have seen on the web for handling the iPod Shuffle problem with loading podcasts using AutoFill.&nbsp; I knew the default "skip when shuffling" was an issue but needed a way to easily change the settings for all of the files.&nbsp; <br />
<br />
It is simple, no extra programs to load, and easy to adapt for multiple playlists.<br />
<br />
Great job, Thank You.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1194041077.36">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> iTunes for Windows script to unset <i>Skip when shuffling</i> </dc:title>
  <dc:creator> Ledona </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    I just upgraded to a 5th gen ipod. After synced I tried playing a podcast playlist,... and of course things did not work as they used to.&nbsp; I thought something was broken (or i was doing something wrong).<br />
<br />
Anyways,... thanks for the script.&nbsp; Great job.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1195202821.49">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> iTunes for Windows script to unset <i>Skip when shuffling</i> </dc:title>
  <dc:creator> Nicholas Mitchell </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    Works like a charm.&nbsp; Thanks!&nbsp; I really appreciate it.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1198608694.17">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> iTunes for Windows script to unset <i>Skip when shuffling</i> </dc:title>
  <dc:creator> Scott </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    Could someone walk me through the steps of using this script.&nbsp; I've never worked with scripts and can't get this to work.<br />
<br />
What I have done (Windows XP Pro):<br />
Created a new text document on my desktop<br />
Edited the document in notepad to include the copy and paste of the above script<br />
Changed the playlist_name to my playlist title (in this case "New_Podcast_Episodes")<br />
Saved the document<br />
Changed the extension to .js<br />
<br />
When I try to run the script, I get the following error:<br />
Script: (the desktop location of the script)<br />
Line: 6<br />
Char: 1<br />
Error: 'New_Podcast_Episodes' is undefined<br />
Code: 800A1391<br />
Source: Microsoft JScript runtime error<br />
<br />
Any idea what I need to do to fix this?<br />
<br />
Thanks!
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1206793554.92">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> iTunes for Windows script to unset <i>Skip when shuffling</i> </dc:title>
  <dc:creator> Brian </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    Scott - Try adjusting the playlist name to something without spaces or underscores.&nbsp; In your example, use NewPodcastEpisodes in both iTunes and in your script.
  </content>
</rdf:Description>
</rdf:li>

<rdf:li>
<rdf:Description rdf:about="#1207525494.71">
  <dc:source> http://snarfed.org/ </dc:source>
  <dc:title> iTunes for Windows script to unset <i>Skip when shuffling</i> </dc:title>
  <dc:creator> Ben </dc:creator>
  <dc:date> cmt_pubDate </dc:date>
  <dc:format> text/html </dc:format>

  <content>
    I get the same error as Brian, and my playlist is named simply "Podcasts".
  </content>
</rdf:Description>
</rdf:li>

  </rdf:Seq>
</rdf:Description>
</rdf:RDF>
