PDA

View Full Version : ipod notes linked to albums (a great alternative playlist)


rockydog
09-21-2004, 05:06 AM
Greeting all

I???ve been trying to learn how to write a script all night and thought maybe you might be interested in this one.

I want to make use of the ability to use links in the notes section on the ipod. With a 40gig ipod, a simple playlist just does not do everything I want it to. Lets say if you want to create a playlist that show the albums instead of the tracks. Or new albums that have been added.

Example 1: (in one file)
---New Albums---
Modest Mouse -The Moon & Antarctica
Modest Mouse -The Fruit That Ate Itself
Rush- Exit Stage left
Wilco - A Ghost is Born
---Albums I haven't heard in a while---
Led Zeppelin - Houses of the Holy
radio Head - Ok Computer
---Artist for that special occasion---
Al green
BT
???Etc

Example 2: (A new text file for every playlist)

Notes>New Albums>
Modest Mouse -The Moon & Antarctica
Modest Mouse -The Fruit That Ate Itself
Rush- Exit Stage left
Wilco - A Ghost is Born

Notes>Albums I haven't heard in a while>
First album
Second album???.

To do this manually it takes a lot of time. Here is the a small text file for use in the notes section of the ipod that I was playing with.

<TITLE>Fav Trance</TITLE>
<meta name="NowPlaying" content="true">
<A HREF="ipod:music?artist=Chris Fortier">Chris Fortier</A>
<A HREF="ipod:music?artist=Chris Fortier&shuffle">Chris Fortier s</A>
Christopher Lawrence
<A HREF="ipod:music?artist=Christopher Lawrence&album=temptation"> temptation</A>
<A HREF="ipod:music?artist=Christopher Lawrence&album=Exposure IV"> Exposure IV</A>
Danny Howells
<A HREF="ipod:music?album=GU Nubreed 002"> GU Nubreed 002</A>
<A HREF="ipod:music?album=Nocturnal Frequencies 3"> Nocturnal Frequencies 3</A>
<A HREF="ipod:music?artist=Danny Howells&album=Renaissance Revelation"> Renaissance Revelation</A>
<A HREF="ipod:music?artist=blur&rating=3">blur 3 star</A>


So I thought I would try to write a script for this. I started out my making a playlist with the stuff that I wanted. Then I tried to modify ???Album-Artist to HTML Table??? and the ???Album-Artist to text??? scripts by trying to get the output to look like this:

<A HREF="ipod:music?artist=Danny Howells&album=Renaissance Revelation"> Renaissance Revelation</A>

I kept getting errors. I tried countless versions of this line:
("<A HREF="ipod:music?artist=&aTracksArtist&& album =&aTracksAlbum & "")
Always a problem at the quote mark before ???ipod???

Well I know my notes are jumbled, Its is way past my bedtime and I am seeing double. hopefully this will interest someone, if not could I get some help with that one line.

other thoughts--

-Then I came across the ???clipboard to notes??? script, man would this would be a nice way to get it onto the ipod.

-Then I had some success with asking the html code to play songs that =3 stars
(<A HREF="ipod:music?artist=blur&rating=3">blur 3 stars</A>)
So now I am wondering if you could save a text file in the same folder as the artist so that you can play songs that have a 3 star rating or higher by clicking the link. Many artist I have like five albums, I don???t want to clutter up my main playlist with this stuff. What do you think?


Thanks
Brian

hitkaiser
09-21-2004, 07:29 AM
Its called "Smart Playlists"... ever had a look in the file menu of itunes?

rockydog
09-21-2004, 12:25 PM
Maybe you need to read the post over. Or maybe you didn't know this is an applescript area. I know about smart playlist and they will help with the initial track/album selection. But then...

Doug Adams
09-21-2004, 09:13 PM
Very interesting! Pardon me while I rub my eyes and pinch myself...

Do you mean to say that the links in the html code in your post are able to actually play a track on the iPod?

This could be scripted, I suppose. I've done some stuff with writing text files to the iPod--Contacts, not Notes; I've got an old iPod!

I am not sure that you would be able to save a text file to an artist folder. iPod tracks are not set up the way the are on the computer.

Use Terminal to look in your iPod for iPod_Control (Volumes/iPod/iPod_Control). Then let us know how you feel :)

Still, very interesting.

rockydog
09-21-2004, 09:48 PM
Yea, take a look at http://developer.apple.com/hardware/ipod/ipodnotereader.pdf Tells all about it!

Doug Adams
09-22-2004, 06:17 AM
Originally posted by rockydog
Yea, take a look at http://developer.apple.com/hardware/ipod/ipodnotereader.pdf Tells all about it! Neat!

Well, what I've done in the past to locate a song is use the UNIX find command with a do shell script in an AppleScript. Song files on the iPod are in iPod/iPod_Control/Music/Fn, where the n is some number. Files seem to be placed in no particular order into the "F" directories (although I hate to say that with any kind of certainty). But using find you can get the true location of a file on iPod. I use the name and size parameters to find, values for which, of course, you can get via AppleScript. So once you find the location of selected tracks' music files on the iPod, you can have AppleScript create the anchor lines, make the Note file, load it into iPod.

So, I suppose you could create your own "playlists" this way. Anxious to see what else you come up with. If you need an example of the find routine have a look at Import iPod Audio Files (http://www.malcolmadams.com/itunes/scripts/ss.php?sp=importipodaudiofiles). Keep us posted!

rockydog
09-22-2004, 01:48 PM
Actually, I think when I asked about putting a note into the artist folder i might of muddied up the waters. Forget that part.

whats cool is how simple it is. You don't need to know the location of the song. If the song or album exist on the ipod, it will find it. If it doesn't exist, It will appear to be just plain text, not a link. Just by making a text file with anchor lines to "album, artist, genera, etc" and saving it in your notes folder on the ipod, it works.

My problem is when I try to have the script make the text file. I want the output of the script to be a simple text file with some basic html lines. The anchor lines need to look like these:

<A HREF="ipod:music?artist=Led Zeppelin&album=Houses of the holy">Houses of the Holy</A>

or if I wanted all of my zeppelin on the ipod to play I would:

<A HREF="ipod:music?artist=Led Zeppelin">All My Zepp</A>

Or greater than 3 stars would be like, I think:

<A HREF="ipod:music?artist=Led Zeppelin&rating>**">Best of Zepp</A>

But when I try running a script that pulls the information out of a itunes playlist and writing it into the html anchor the problem starts. here is part of the script that builds the anchor line. And the RED quote mark is the error. It seems that the quote mark is interfering with the script. The script thinks that the quote make is an end to the "add_to_contents" command. Can I have the script just ignore that one quote mark?

my add_to_contents("<A HREF="ipod:music?album=&aTracksAlbum&">&aTracksAlbum&</A>")

Doug Adams
09-26-2004, 07:16 PM
You must escape double-quotes in an AppleScript string using the "\" character...are you doing that? Your statement should probably look like this:

my add_to_contents("<A HREF=\"ipod:music?album=" & aTracksAlbum & "\">" & aTracksAlbum & "</A>")

WoodenBrain
07-10-2005, 03:42 PM
I have a script to make catalogs of iPod playlists by artist/album in notes. It was a snap to modify it to include live links, once i noticed this post. what a great idea! Thanks.

anyway, it will be available as "Make iPod Playlist Catalog with Links" in an update shortly to my WBC iTunes Scripts Collection. Watch for it on Version Tracker.