Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jan 7, 2012, 02:33 AM   #1
luigidorf
macrumors newbie
 
Join Date: May 2009
Using AppleScript to make daily todos?

I've been trying to figure out a way to make todos (reminders) that recur every day (or week). iCal doesn't have this functionality built in, but it seems possible with AppleScript. The problem is, I am clueless when it comes to AppleScript and I can't get anything to work beyond very simple commands.

If someone has done this, I would be delighted to see the code. I do have some programming experience (mostly C++), so I'm sure if I saw it I would understand it right away.

I'll say the task seems very simple if I can figure out how to access the data and actions in iCal. Here's some pseudo code for what I'd do:
Code:
if(time = 00:00)
{
    for(each reminder that I want to recur)
    {
        for(each reminder in iCal)
        {
            if(name of reminder I want to recur = name of reminder in iCal)
                break
            make the reminder I want to recur
        }
    }
}
Can anyone help me translate this into AppleScript?

Thanks in advance!
luigidorf is offline   0 Reply With Quote
Old Jan 7, 2012, 04:35 AM   #2
jiminaus
macrumors 65816
 
Join Date: Dec 2010
Location: Sydney
Edit: Sorry, you're talking about reminders, not events.


iCal does have repeating events. At least iCal under Lion does. I can setup an event to repeat every day, every week, every month or every year. Or I can setup a custom repeat and completely control on which days and at what frequency.

Does this not work for you?

Last edited by jiminaus; Jan 7, 2012 at 04:37 AM. Reason: Got it wrong
jiminaus is offline   0 Reply With Quote
Old Jan 7, 2012, 06:58 PM   #3
luigidorf
Thread Starter
macrumors newbie
 
Join Date: May 2009
Quote:
Originally Posted by jiminaus View Post
Edit: Sorry, you're talking about reminders, not events.


iCal does have repeating events. At least iCal under Lion does. I can setup an event to repeat every day, every week, every month or every year. Or I can setup a custom repeat and completely control on which days and at what frequency.

Does this not work for you?
I realize I could just have a separate calendar for reminders, and use events instead, but it wouldn't be the same. Even if the functionality were almost identical, I'd still like to be able to do this in AppleScript so I'll be able to apply what I've learned to other scripts.
luigidorf is offline   0 Reply With Quote
Old Jan 7, 2012, 07:44 PM   #4
subsonix
macrumors 68030
 
Join Date: Feb 2008
Your script will rely on it running constantly in the background, checking if the current time match your events. If your script gets killed you will oversleep so to speak, what if every script that handle timed events would constantly run? It would be a mess. The os provides mechanisms to handle this for you, use them instead. The simplest is to use cron, and create a crontab to launch your script periodically.
subsonix is offline   0 Reply With Quote
Old Jan 7, 2012, 10:02 PM   #5
luigidorf
Thread Starter
macrumors newbie
 
Join Date: May 2009
Quote:
Originally Posted by subsonix View Post
Your script will rely on it running constantly in the background, checking if the current time match your events. If your script gets killed you will oversleep so to speak, what if every script that handle timed events would constantly run? It would be a mess. The os provides mechanisms to handle this for you, use them instead. The simplest is to use cron, and create a crontab to launch your script periodically.
I'll look into cron, thanks for that. Still clueless on the AppleScript thing.
luigidorf is offline   0 Reply With Quote
Old Jan 10, 2012, 05:46 PM   #6
sero
macrumors member
 
Join Date: Aug 2008
are you familiar with remind?
sero is offline   0 Reply With Quote
Old Jan 11, 2012, 06:04 AM   #7
iHutch105
macrumors member
 
Join Date: Aug 2011
Your pseudo-code suggests that this script will only run at precisely midnight, are you sure that's what you want?

Also, wouldn't it run multiple times per minute?

Just a couple of thoughts.
__________________
2011 iMac 27" | 2009 MacBook 13" | iPhone 4 16GB Black
iHutch105 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
How can i make applescript run on a button Intelligent Mac Programming 3 Mar 10, 2014 03:29 PM
Photo 365: Make memories daily with the best project 365 app! (For iOS) Jimmy Lawson iPad Apps 0 Jan 14, 2014 07:50 AM
How to make commands With AppleScript? TannerWord OS X 10.8 Mountain Lion 4 May 19, 2013 11:51 PM
I want to make AppleScript Create Folder DavidBlack Mac Programming 27 Mar 15, 2013 06:18 PM
Applescript to make terminal close automatically? Ri-dog Mac Programming 1 Jan 18, 2013 12:53 PM

Forum Jump

All times are GMT -5. The time now is 12:35 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC