Page 1 of 1

Retrieving Indigo events ...

PostPosted: Sun Dec 23, 2012 2:47 pm
by rlesperance
Hi Matt,

In Indigo 1.8.2 (a long long time ago ...) I was able the retrieve Indigo’s events and setup a wake up schedule in the Power Manager application. Now my old script does not work. I changer Indigo for IndigoServer, but still can get the event list. Can you help me with what is not working ? Here is my previous script:


Code: Select all
tell application "IndigoServer"
   repeat with i in time date actions
      if i is enabled then
         if name of i does not contain "internal" then
            
            -- ... copy the name and the scheduled time of the event, ...
            --- ... copier le nom et le moment de déclanchement de l'événement, ...
            set EventName to name of i
            set NextTrigger to (next trigger time) of i
            
            --- ... in Power Manager, delete all event that already exist with the same name ...
            --- ... détruire tout événement déjà existant dans Power Manager portant le même nom ...
            LogToIndigo(EventName, "& ", NextTrigger)
         end if
      end if
   end repeat
end tell


-- Routine to log text in Indigo
--  Permet d'inscrire un texte dans le log d'Indigo
on LogToIndigo(theTextToLog)
   tell application "IndigoServer"
      log theTextToLog
   end tell
end LogToIndigo

Re: Retrieving Indigo events ...

PostPosted: Mon Dec 24, 2012 10:44 am
by matt (support)
To get the script running here I just had to change this line:

Code: Select all
            LogToIndigo(EventName, "& ", NextTrigger)

to:

Code: Select all
            my LogToIndigo(EventName, "& ", NextTrigger)

Re: Retrieving Indigo events ...

PostPosted: Mon Dec 24, 2012 6:06 pm
by rlesperance
Hi Matt ... In the script editor, I always get an code -10810 error message. Any idea what could be the problem ?

Re: Retrieving Indigo events ...

PostPosted: Mon Dec 24, 2012 6:12 pm
by matt (support)
Unfortunately, no. I was running it in the Script Editor as well. I'm not sure what the difference is between our configurations (this Mac is running OS X 10.7.5). I googled on that error and there were lots of hits, but nothing jumped out as particularly useful.

I'd suggest you try reducing the script down to see what exactly is causing it to fail.

Re: Retrieving Indigo events ...

PostPosted: Mon Dec 24, 2012 6:17 pm
by rlesperance
I tried this simple script :

Code: Select all
tell application "IndigoServer"
   log "hello"
end tell



... and got the same error. I will have to dig this error.

Re: Retrieving Indigo events ...

PostPosted: Mon Dec 24, 2012 6:20 pm
by matt (support)
What version of Indigo and Mac OS are you running? There is a problem with older versions of Indigo and Mountain Lion. It is fixed in Indigo 5.1.5 and Indigo 6.

Re: Retrieving Indigo events ...

PostPosted: Mon Dec 24, 2012 6:34 pm
by rlesperance
I am using Indigo 5.1.7 and OS 10.8.2 ...

Re: Retrieving Indigo events ...

PostPosted: Mon Dec 24, 2012 6:53 pm
by matt (support)
That should be good. Choose Indigo->About Indigo just to make sure that Indigo Server is 5.1.7. Sometimes the client/server versions get out of sync.

Re: Retrieving Indigo events ...

PostPosted: Mon Dec 24, 2012 7:25 pm
by rlesperance
Both are v5.1.7 ...