looking for Applescript mentor

Discussion in 'Mac Apps and Mac App Store' started by buckuxc, Feb 15, 2004.

  1. buckuxc macrumors regular

    Joined:
    Aug 28, 2003
    #1
    hey all,

    I'm an Applescript noob, but I have an idea for something to work with iTunes that I really want to try and implement. Before I go ahead with spending the extra time learning Applescript to bring this idea to life, I have some questions about the power and the limits of Applescript, especially in conjunction with iTunes. Is there anyone that wouldn't mind keeping an email conversation with me to help me out? Thanks.


    sps
     
  2. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #2
    Any reason not to use the forums? It might be less personal, but then you benefit from our joint knowledge instead of from just one person. And other AppleScripters like me will benefit by listening in.

    For iTunes scripting, I suggest that you start by collecting the iTunes scripts already written by others, especially where source code is provided, so you can see what's possible and what's already been done.
     
  3. evil_santa macrumors 6502a

    evil_santa

    Joined:
    Sep 23, 2003
    Location:
    London, England
    #3
    Try Doug' Applescripts for itunes

    If Doug doesnt have a script for what you want to do, I find its a good starting point to work from one of his scripts and mod it to my needs.

    What do you want the script to do?

    http://www.malcolmadams.com/itunes/index.php
     
  4. buckuxc thread starter macrumors regular

    Joined:
    Aug 28, 2003
    #4
    i tried posting to the forum

    ....a day or two ago. Acutally, two forums. I posted my idea. No one responded. I have a better idea, formulated from the last one, but this time I'm just gonna do it myself. I need to find out if specific tasks possible with Applescript, though, before I start spending my little free time figuring it out; otherwise, maybe it's possible with Cocoa? If someone can tell me that, that would ok, too. To begin I suppose my first questions are these:

    1) Is it possible to have Applescript export playlists? I could not find this function in the dictionary.

    2) Is it possible for an Applescript to work with more than one program, say iTunes and Text Editor? Or must you have separate scripts for each?

    3) Is it possible with Applescript to compare text within more than one file? For example, I have 5 exported song lists in 5 different XML files. I want to find any XML strings that are exactly the same in 2 or more of these XML files.

    or

    is it possible in iTunes to export 5 separate playlists to the same XML file? Then with Applescript, search the entire XML file for strings that show up more than once?

    That's my questions for now. Read the next post for my reasoning.
     
  5. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #5
    Re: i tried posting to the forum

    Sorry. I didn't see it. It's lousy when nobody responds to a post.
    Yes. The tell command directs AppleScript actions to particular programs, and you can use as many tell commands as you like.
     
  6. buckuxc thread starter macrumors regular

    Joined:
    Aug 28, 2003
    #6
    Reasoning

    If anyone is familiar with the iTunes Top 20 Playlist strategy over at SmartPlaylists.com, then this should make sense. Basically, there are 3 playlists:

    Favs - Hot:
    Five Stars AND
    Last Played is in the last 3 days

    Favs - Recyled
    Five Stars AND
    Last Played is not in the last 1 week
    Last Played is in the last 2 weeks

    Favs - Forgotten
    Five Stars AND
    Last Played is not in the last 4 weeks

    This is a good strategy for listening to those songs that are stuck in your head at any given point in time. However, you have to constantly evaluate which songs are worth 5 stars and manually set them. This isn't that bad, unless you're like me and are in the process of ripping your entire CD collection to your computer; trust me, you can't listen to THAT much music and stay sane, live your life, etc...

    What is needed is a way to determine how many times a song has been played in the last couple of days, then give it 5 stars or not based on this criteria. There is, sadly, no way of keeping track of PlayCount within the last N days. I'm trying to determine a way. I made 5 new playlists (could be a different number if you want) with these criteria:

    Last 1 day: Last Played is in the last 1 days

    Last 2 days: Last Played is in the last 2 days and Last Played is not in the last 1 days.

    Last 3 days: Last Played is in the last 3 days and Last Played is not in the last 2 days.

    Last 4 days: Last Played is in the last 4 days and Last Played is not in the last 3 days.

    Last 5 days: Last Played is in the last 5 days and Last Played is not in the last 4 days.

    If a song has been played on 2 or more days in the last 5 days, then it will appear on more than one of those playlists. If one could compare the results of those 5 playlists, even just once a day at the end of the day, then one could find songs that show up on more than one. If then one could have the rating automatically set to 5 stars on any song that does appear on two or more of those lists, the one could dynamically have their songs tastes recorded.

    I would also think about adding a Not Played in N amount of days/weeks/months list, and having the Applescript (or perhaps a Cocoa app or iTunes plugin for either of these ideas???) decrease the rating to 4, then to 3 (after longer), then to 2...etc...

    I know this is long, but hopefully a few people with better knowledge can help me and help each other towards a solution...

    ...at least until Apple adds this sort of feature (along with boolean "or" capabilities in Smartlists).

    sps
     
  7. buckuxc thread starter macrumors regular

    Joined:
    Aug 28, 2003
    #7
    maybe iTunes Database FMP v1.8.5

    Maybe one could this by fiddling with this Applescript? Then instead of comparing text strings in several XML files, one could compare values in a database.

    Only one catch: I don't have Filemaker Pro...and I don't know how many actually do. However, could this be implemented using Apache? Isn't that a database app that is included on every OS X machine?

    sps
     
  8. evil_santa macrumors 6502a

    evil_santa

    Joined:
    Sep 23, 2003
    Location:
    London, England
    #8
    Re: i tried posting to the forum

    Im not that good with apple script, ive only writen a few simple script, but i hope this helps..


     

Share This Page