Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.
Topic: Trying to search all tracks based on properties
|
|
#1
|
||
|
Freshman Lounger
Join Date: Sep 2009
Location: Washington DC
Posts: 7
|
I want to build a script which can search all playlists or specific playlists for tracks which meet any of the properties, or combinations of properties I specify, and which can, once selected, report back on the length of the track to be added to the playlist I'm creating.
I expect several tracks to meet the search criteria, and the ability to randomly select one of the matching tracks is desirable. I've searched the forum, and haven't found anything which specifically says how to search for tracks based on anything other than the basics. any help is appreciated for this applescript newbie. joelb |
||
|
|
|
Join the iLounge Community and the ad above will disappear.
|
|
#2
|
||
|
Veteran Lounger
Join Date: Jun 2004
Location: Midstate New York
Posts: 5,191
|
It's called a smartlist.
__________________
Take control of your iPod with smartlists |
||
|
|
|
|
|
#3
|
||
|
Freshman Lounger
Join Date: Sep 2009
Location: Washington DC
Posts: 7
|
Um... I'm not *THAT* new.
![]() I need to be able to select a bunch of songs with different criteria for all of them, then combine those into a playlist which is as close to sixty minutes and no seconds as I can. The problem would be having to create a couple dozen smartlists to find the individual songs. Complicating the matter is they all need to trigger off Genre, which I need to be able to change. The upshot is I used to work in radio (back in the day) and I want to create a format to create an hour long playlist. The criteria except Genre or Playlist (for collections which aren't genre specific) are the same, if I could update all the smart lists to change the 'Genre' or playlist they reference might work. Then I'd have the problem of having to subtotal the songs, and pick the last song by time alone. So that's the end I'm trying to accomplish. A little more involved than just a smart playlist can handle. ![]() That said, any ideas? |
||
|
|
|
|
|
#4
|
||
|
Veteran Lounger
Join Date: Jun 2004
Location: Midstate New York
Posts: 5,191
|
Uh, it's still called a smartlist.
In fact, you can give all the parameters you want, then say "Limit to 60 minutes selected according to random" at the bottom of the smartlist. iTunes will do all the heavy lifting for you. And with forked internal logic any more, unless it's necessary to weight the percentages of the final make up, you can even do it in a single playlist no matter how complex the logic.
__________________
Take control of your iPod with smartlists |
||
|
|
|
|
|
#5
|
||
|
Freshman Lounger
Join Date: Sep 2009
Location: Washington DC
Posts: 7
|
Ok
How about this. I've got it mostly solved. But I need some code to search a playlist and choose a track based on the duration of the track. Everything else is solved. joelb set ANums to 1 set BNums to 1 set CNums to 1 set DNums to 1 set ONums to 1 tell application "iTunes" copy track ANums of user playlist "A's" to playlist "Now Playing" set ANums to ANums + 1 copy track CNums of user playlist "C's" to playlist "Now Playing" set CNums to CNums + 1 copy track BNums of user playlist "B's" to playlist "Now Playing" set BNums to BNums + 1 end tell tell application "iTunes" if duration of playlist "Now Playing" is less than (15 * minutes) then copy track ONums of user playlist "Oldies" to playlist "Now Playing" set ONums to ONums + 1 end if end tell tell application "iTunes" copy track ANums of user playlist "A's" to playlist "Now Playing" set ANums to ANums + 1 copy track DNums of user playlist "D's" to playlist "Now Playing" set DNums to DNums + 1 copy track BNums of user playlist "B's" to playlist "Now Playing" set BNums to BNums + 1 end tell tell application "iTunes" if duration of playlist "Now Playing" is less than (30 * minutes) then copy track ANums of user playlist "A's" to playlist "Now Playing" set ANums to ANums + 1 end if end tell tell application "iTunes" copy track ANums of user playlist "A's" to playlist "Now Playing" set ANums to ANums + 1 copy track DNums of user playlist "D's" to playlist "Now Playing" set DNums to DNums + 1 copy track CNums of user playlist "C's" to playlist "Now Playing" set CNums to CNums + 1 end tell tell application "iTunes" if duration of playlist "Now Playing" is less than (45 * minutes) then copy track BNums of user playlist "B's" to playlist "Now Playing" set BNums to BNums + 1 end if end tell tell application "iTunes" copy track ANums of user playlist "A's" to playlist "Now Playing" set ANums to ANums + 1 copy track BNums of user playlist "B's" to playlist "Now Playing" set BNums to BNums + 1 copy track ONums of user playlist "Oldies" to playlist "Now Playing" set ONums to ONums + 1 end tell tell application "iTunes" set PrefillTime to duration of playlist "Now Playing" set TimeToFill to 3600 - PrefillTime end tell tell application "iTunes" -- this is the part that I keep screwing up now. --I need to search playlist "A Top of Hour" for a track that matches TimeToFill end tell |
||
|
|
|
|
|
#6
|
||
|
Freshman Lounger
Join Date: Sep 2009
Location: Washington DC
Posts: 7
|
tell application "iTunes"
-- do some loop through all tracks of playlist set CurrentDuration to duration of track ATOHCount of playlist "A Top of Hour" set CurrentDuration to round (CurrentDuration) if CurrentDuration = TimeToFill then copy track ATOHCount of user playlist "A Top of Hour" to playlist "Now Playing" end if --loop return end tell |
||
|
|
|
|
|
#7
|
||
|
Veteran Lounger
Join Date: Jun 2004
Location: Midstate New York
Posts: 5,191
|
Hey, I'd like to apologize for the above. I didn't pay attention that you posted this specifically to the scripts forum (I just always grab the daily posts), so even though I don't know why you're doing what you're doing when you could do the same thing with some smartlists as best I can tell and save yourself the trouble, I was out of line.
Good luck figuring out the part of the script you want, Apple Script is not my area of expertise.
__________________
Take control of your iPod with smartlists |
||
|
|
|
|
|
#8
|
||
|
Freshman Lounger
Join Date: Sep 2009
Location: Washington DC
Posts: 7
|
![]() No sweat. Most radio stations have a format that they follow. I wanted to emulate that as closely as possible. The idea is A songs are Hot Popular Current. B songs are similar, but either on the way down or up, and not deserving of the heavier rotation of an 'A' spot. C songs are songs that didn't go as high as an A or B, but were good none the less, but are worth bringing up somewhat regularly. D songs are the honorary mentions of the top charting songs and again are just scattered in for flavor The Oldies are formerly A's and B's but are at least 10 years old. Plan to the quarter hour, 4 songs per quarter,with the last of the 4 being 'optional' based on how long the first 3 run. I want to mimic actual format, so I don't just want to dump the songs which match into a playlist. This is where music directors make the big bucks. A station's format is usually fairly well guarded. The format here I'm doing from memory when I worked in Top 40 radio. The station has been country for more than a decade, so I'm not giving away state secrets buy posting my code. Anyway, that's why I was sooo picky about what I was trying to accomplish |
||
|
|
|
|
|
#9
|
|||
|
Veteran Lounger
Join Date: Jun 2004
Location: Midstate New York
Posts: 5,191
|
Quote:
For example, once somone came in here looking for feedback on a two page Visual Basic program they had written to automate renaming .m4a files to .m4b extension files. They were both surprised and chagrined to learn that what they had spent days working on, required specific .net runtimes to be installed, etc. could be accomplished by the 15 characters: "ren *.m4a *.m4b" either from the command prompt or as a 1k batch file.
__________________
Take control of your iPod with smartlists |
|||
|
|
|
Topic: Trying to search all tracks based on properties
Become a member of the iLounge Forums. Register Now!
To start viewing messages, select the forum that you want to visit from the selection below.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.
If this is your first visit, be sure to check out the Forum FAQ and Forum Policy.
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MP3 Audiobooks, tracks, and bookmarking? | Pilaar39 | Books and Spoken Word | 11 | 05-12-2009 03:23 PM |
| autodelete tracks script ? | nimionsergei | AppleScripts for iTunes (Mac) | 0 | 10-14-2008 03:23 PM |
| select tracks based on length? | lowaffect | AppleScripts for iTunes (Mac) | 1 | 09-14-2008 11:27 PM |
| Autosync randomly removes tracks | smoyerjx | iPod classic & Legacy iPods | 2 | 07-10-2005 12:32 PM |
| Auto sync removes tracks in error | smoyerjx | iTunes + Related Mac/PC Applications | 0 | 06-15-2005 01:07 PM |
View iLounge History. Read our old Forums Archive (2001-2003)
All times are GMT -4. The time now is 05:08 PM.
All times are GMT -4. The time now is 05:08 PM.





Trying to search all tracks based on properties









Linear Mode



