[Apple Script] auto label unplayed movies

Discussion in 'Mac Programming' started by alptkz, Mar 27, 2009.

  1. alptkz macrumors newbie


    Feb 26, 2009
    hi all.

    I'm trying to write a script (very little experience here) for a folder action that will label in blue all the video files in my Movies folder that have never been played.

    I find myself way over my head on this. Can anyone help me out ?
  2. LtRammstein macrumors 6502a


    Jun 20, 2006
    Denver, CO
    Have you looked into the AppleScript iTunes library? I belive there's an element in there that would allow you to do it, but not sure (on a PC in a lab right now).

    You might need to also teach yourself AppleScript before you go any further. I recommend you search Google for any tutorials that might help out.
  3. alptkz thread starter macrumors newbie


    Feb 26, 2009
    I looked in the iTunes dictionary, but I'm not really sure what to look for. In fact, why is iTunes involved at all ?

    The way I picture it, the script would check in a folder if the video files (all avi actually) have been played or not, and if not, assign a blue label, if yes then no label.

    The question is, is there a way to check whether the file was played (or opened) or not. If not, I'm guessing I'd need to do it in 2 scripts. One that watches for added files and labels them as soon as they are added. The 2nd would remove the label as soon as the file is played.

    Am I looking at this wrong ?
  4. alptkz thread starter macrumors newbie


    Feb 26, 2009
    Ok I've gone for option 2 as it seems more straight forward. I've created succesfully one script that labels any video file added to my Movies folder. It looks like this:
    That works great, but it doesn't include subfolders. How can I do that?

    Then I created a 2nd script that would remove the label when a video file is opened. It doesn't work though. This is what I wrote so far:
    I'm guessing my problem is on the first blue line, I just don't know what to use there.

    Any ideas ?

Share This Page