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

Create smart playlists for all artists in iTunes Apps
I wrote this short AppleScript to make a smart playlist for every artist in my iTunes folder. You'll need to enter your own directory on the line that starts set tunesFolder, possibly change the keystroke commands if you've changed yours in iTunes, and finally, edit the delay 1 lines if your machine is too slow to keep up.

The script takes about one minute to process each 20 artists, so be patient. I was forced to use System Events, because there is no way to create smart playlists directly from AppleScript.

[robg adds: I haven't tested this one, but you should probably also quit iTunes before running the script.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[9,265 views]  

Create smart playlists for all artists in iTunes | 10 comments | Create New Account
Click here to return to the 'Create smart playlists for all artists in iTunes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
a suggestion...
Authored by: airdrummer on Mar 08, '07 08:31:25AM
i think you are trying to extract the artist name from the pathname, but you are doing it the hard way, inspecting the string character-by-character, looking for ":".
applescript does have some features that make it easy...replace this code:
	set m to ((count of pathQ) - 1)
	set pathQ to characters 1 through m of pathQ as string
	set x to m
	--artist name getting loop
	repeat
		set z to x
		set char1 to character x of pathQ
		if char1 is ":" then
			exit repeat
			end if
	        set x to x - 1
	end repeat
	set artistQ to characters (z + 1) through m of pathQ as string
with this:
	set AppleScript's text item delimiters to {":"}
	set artistQ to last text item of pathQ
	set AppleScript's text item delimiters to {""}
and see if it doesn't run faster;-)

[ Reply to This | # ]
oops...
Authored by: airdrummer on Mar 08, '07 08:36:19AM
forgot to trim the trailing colon:
    	set artistQ to text item -2 of pathQ


[ Reply to This | # ]
Create smart playlists for all artists in iTunes
Authored by: maczen on Mar 08, '07 08:36:09AM

I am missing why this is useful?
You can just browse artists within iTunes, no need to make a script for smart lists.



[ Reply to This | # ]
Create smart playlists for all artists in iTunes
Authored by: DougAdams on Mar 08, '07 08:51:28AM
Hmm. I thought GUI Scripting of the Smart Playlist Info window was not possible. Must be new. (Although since "Artist" is the default initial criteria, maybe not so far-fetched. Adding new criteria would be the money shot.) Also, in the script "iTunes7" should be just "iTunes". And, sorry to say, I have to agree that I think Browse mode is easier; why have all those playlists to navigate?

---
Doug's AppleScripts for iTunes
http://www.dougscripts.com/itunes/

[ Reply to This | # ]

Create smart playlists for all artists in iTunes
Authored by: lxmorj on Mar 08, '07 10:31:50AM

Thanks for that- I never quite understood the text delimiters till now.... iTunes7 is because I tried to install 6 and 7, so i could use iTunes sharing w a clamshell I've installed Tiger on- its processor is too crap to handle 7... and yes, the script isn't that useful. I had it in mind to make all sorts of smartlists, but there is no support for that window in Applescript, so I had to cop-out and use System Events, and cut the script short...



[ Reply to This | # ]
Create smart playlists for all artists in iTunes
Authored by: designbot on Mar 09, '07 06:42:07AM

Why on earth would you want to do this? All those Smart Playlists will slow iTunes to a crawl, and you can get superior functionality by just pressing the "Browse" button in the lower-right of your window.



[ Reply to This | # ]
Create smart playlists for all artists in iTunes
Authored by: DavidRavenMoon on Mar 09, '07 07:30:40AM

Yeah I can't figure out why this is useful either. I almost never use the browse feature, but I do sort my main window by artist anyway. So I just scroll to the artist I want.

If I really want to save time I just type part of the name in the search field. Takes all of two seconds.

A lot of tips on here seem like the hard way to get to a simple solution! What's next, control iTunes though the terminal? (ooh all that typing... how very geekish!) ;)

I usually end up with too many playlist anyway, and they are always changing, like when I get a new album...



---
G4/Digital Audio/1GHz, 1 GB, Mac OS X 10.4.8 • www.david-schwab.com • www.myspace/davidschwab • www.imanicoppola.net



[ Reply to This | # ]
Create smart playlists for all artists in iTunes
Authored by: renatomarques on Mar 09, '07 01:48:57PM

Ok, I was really looking for something like this (actually,
I found it through google). However, I am a one-month Mac
user, coming from Gate$$ lands, and do not have even a clue
on how to make this script run.
Anyone can help me with som elink to a tutorial on
"what is a script", "how to run a script", etc??
And, if there is some specific place I should place this one, I
would also thank a lot for the advice.
Hope this is not a bother for you guys.
Thanks a lot



[ Reply to This | # ]
Create smart playlists for all artists in iTunes
Authored by: DeltaTee on Mar 13, '07 09:19:13AM
See Doug's site for more information. (Look in the "manual install" portion.

http://dougscripts.com/itunes/itinfo/downloadfaq.php

[ Reply to This | # ]
Create smart playlists for all artists in iTunes
Authored by: astguy on Sep 13, '07 10:27:41AM

This is EXTREMELY useful if you have an iPod & you just want to sync certain artists to the iPod.

Thanks -- checking it out now!



[ Reply to This | # ]