Changing indigo variable when reminder marked as complete

Posted on
Wed May 09, 2012 9:43 am
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Changing indigo variable when reminder marked as complete

I am using indigo to count and create a reminder based on a device turning on. Once the device turns on 3 times, it creates a reminder. This I have working properly... Once "Counter" variable increments to 3, I have a script that I'm creating the reminder in ical, and then I'm using reminders in ical to push to my "Things" iPhone app "todo" list.

Now the challenge... when I check a "Things" todo as complete, it update ical's reminders todo. What I would like to do, is have this event reset the "Counter" variable back to zero when it has been completed. Maybe this is too much to ask the system to do...

Basically I'm creating a recurring reminder, after completion, based on a variable within indigo, but I'm pushing all this through ical reminders.

It is always the same reminder. "Do X"... so I think that simplifies the problem a bit.

Posted on
Wed May 09, 2012 11:19 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Changing indigo variable when reminder marked as complet

Hi there.

Assuming iCal is on the same machine as Indigo, you could set up a repeating Schedule in Indigo (set to repeat every, say, 1 minute) that runs an embedded AppleScript. The code might look something like
Code: Select all
tell application "iCal"
   run
   tell calendar "Your Calendar Name"
      set theToDos to every todo whose summary is "Do X"
      if (count theToDos) > 0 then
         set theDate to completion date of item 1 of theToDos
         if theDate is not missing value then
            tell application "IndigoServer" to set value of variable "YourCounterVariable" to "0"
         end if
      end if
   end tell
end tell

Posted on
Wed May 09, 2012 12:30 pm
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: Changing indigo variable when reminder marked as complet

nsheldon,
Thanks... this seems to be working in my testing. A little flakey in some parts, but nothing to do with indigo or your script. Just the syncing side of things...

Posted on
Wed May 09, 2012 2:23 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Changing indigo variable when reminder marked as complet

Dewster35 wrote:
nsheldon,
Thanks... this seems to be working in my testing. A little flakey in some parts, but nothing to do with indigo or your script. Just the syncing side of things...

Cool. Glad it helped. :-)

Posted on
Mon May 14, 2012 7:57 pm
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: Changing indigo variable when reminder marked as complet

Nsheldon,
Any idea on how to add a due date as 2 days from TODAY when I create my todo?

Posted on
Mon May 14, 2012 8:35 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Changing indigo variable when reminder marked as complet

Dewster35 wrote:
Nsheldon,
Any idea on how to add a due date as 2 days from TODAY when I create my todo?

Do you mean via AppleScript? Each ToDo item has a separate "due date" property (just like "completion date" is a property). However you're creating your ToDo item, just add the property "due date:(current date) + 2 * days" to the property list. Or, within a "tell calendar" section, you could use
Code: Select all
set theToDos to every todo whose summary is "Do X"
if (count theToDos) > 0 then
   set due date of item 1 of theToDos to (current date) + 2 * days
end if

Posted on
Fri Oct 05, 2012 7:06 am
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: Changing indigo variable when reminder marked as complet

Nsheldon... any idea how to do this using Mountain Lion's reminder application? I fiddled around with it and got it to create the todo... but I can't put it in a position in the list like I could previously.

Posted on
Fri Oct 05, 2012 11:26 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: Changing indigo variable when reminder marked as complet

Dewster35 wrote:
Nsheldon... any idea how to do this using Mountain Lion's reminder application? I fiddled around with it and got it to create the todo... but I can't put it in a position in the list like I could previously.

No, sorry. I don't have Mountain Lion at home (systems are too old to run it). I do have it installed here at work, but I couldn't get Reminders to reorder the list. I noticed there are some related complaints on the Apple Support forums about Reminder list orders and syncing. Sorry I couldn't help more.

Posted on
Fri Oct 05, 2012 12:29 pm
Dewster35 offline
Posts: 1030
Joined: Jul 06, 2010
Location: Petoskey, MI

Re: Changing indigo variable when reminder marked as complet

No problem. I was struggling and thought I'd take a stab at it. This is even only part of my current problem. I use the application things for my go to todo list and they recently eliminated reminders syncing, so I would have still needed a work around to get by that.

Thanks for looking into it though :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 13 guests