Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Organize podcasts automatically via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Organize podcasts automatically via AppleScript
Authored by: jstripli on Mar 03, '05 03:09:05PM
If you want it to grab your list automatically, or if you have a lot of pod casts you can change the first line from
 set listofpl to {"In Our Time", "Inside Mac Radio", "Adam Curry Daily Source Code"} 
to having listpl grab the results of a shell script like:
 grep \# ~/iPodderData/favorites.txt | tr -d "#"| cut -c 2-100 |  awk '{print "\""$0"\","} ; NR = 0 {++count} END'  
Unfortunately, this needs a little bit more work, such as strip out all special characters as well as the "," at the end of the line.

But this should be enough to get some resourceful scripter started :-)

[ Reply to This | # ]

Organize podcasts automatically via AppleScript
Authored by: Scott Windsor on Mar 23, '05 12:18:48PM
Here's an improved version that uses the suggested grep (with a few tweaks), and then organizes your podcasts. Unlike the first applescript, this doesn't add to a "Podcast" playlist. You can set up smart playlists in iTunes that are conditional on Genre. I have a really useful "New Podcasts" playlist where the Genre is "Podcast", and it's limited to the last 15 most recently added. the script...

set raw_favs to do shell script "grep \\# ~/iPodderData/favorites.txt | tr -d '#' | tr -d ':' | tr -d '/' | cut -c 2-100"

set favorites_list to {}
repeat with x from 1 to (count paragraphs in raw_favs)
	copy (paragraph x of raw_favs) to end of favorites_list
end repeat

tell application "iTunes"
	set playlist_list to (get every user playlist whose smart is false)
	
	--check for a playlist whose name that matches one in favorites_list
	repeat with j from 1 to count of playlist_list
		repeat with i from 1 to count of favorites_list
			if item i of favorites_list = name of item j of playlist_list then
				--for each song in this playlist
				repeat with t from 1 to ((count of every file track) of item j of playlist_list)
					--change genre
					tell file track t of item j of playlist_list
						set genre to "Podcast"
					end tell
				end repeat
				--erase playlist
				delete item j of playlist_list
				return
			end if
		end repeat
	end repeat
end tell
I wasn't quite able to get iPodder to run this after it imports songs, but if you add it to ~/Library/iTunes/Scripts it will show up on your iTunes applescript dropdown.

[ Reply to This | # ]