LearningTheRopes
LearningTheRopes

Reputation: 3

Applescript, preform certain action on a certain day

I'm not sure if this is possible, but is there a way to have a script run to check the day and if its monday copy, for example, cell A1, and if its tuesday copy cell B2, so on and so forth.

Upvotes: 0

Views: 373

Answers (2)

Nick Groeneveld
Nick Groeneveld

Reputation: 903

Create an 'on idle' script that runs every 24 hours. Save this script as a 'stay open' application.

on idle

    -- Set variable d to the current date
    set {weekday:d} to (current date)

    -- Check if current date is equal to monday
    if d is equal to "mon" then
        -- Do your actions here
    end if

    -- Run this script every 86400 seconds (one day)
    return 86400

end idle

Upvotes: 0

Craig Smith
Craig Smith

Reputation: 1071

Yes, there is a way, but it is a two-step process. Once you have an AppleScript that works the way you like, you design a Launch Daemon that fires every Monday, and it will run the script.

Upvotes: 1

Related Questions