Applescript to Generate text based on day of the week and time.

Discussion in 'Mac Programming' started by kdpyke, Sep 12, 2012.

  1. kdpyke macrumors newbie

    Joined:
    Sep 12, 2012
    #1
    Hi I think that what I need is pretty simple, but scripting it out may be very difficult. I'm pretty new to scripting in general, so I'm hoping someone can help me out.

    I've been using automator to do some automatic video recording via QT. Getting the video to record is super easy, but handling the file afterward seems to be clunky and limited. Basically, I need a script that will generate a line of text to be used as a filename, contingent on what time and day of the week it currently is.

    For example, if today is Friday between 6 and 7AM, I would like the result of the script to be "Waking up {day of week}, {current date} 6-7".

    However if it is Tuesday between 1 and 2PM, I would like the result to be "Eating Lunch {day of week}, {current date} 1-2"

    If I make a recording that is at an off time, where I haven't specified a time or event, I'd like the result to be "Unsorted video recording {day of week}, {current date}, {current hour:minute}".

    Is this possible, and how difficult is it?
     
  2. sero macrumors member

    Joined:
    Aug 28, 2008
    #2
    It's not difficult. In bash check out date and conditionals (if,then,else).

     

Share This Page