Access to Cocoa Framework

Posted on
Fri Feb 26, 2016 2:05 pm
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Access to Cocoa Framework

Hi Matt, Jay,

In my setup what is missing is a "calendar parsing" plugin or something similar (I know there is the iCalProcessor plugin but alarm is needed, e-mail check and so on and as far I remember it is not possible to set time format or something similar)
There is also another plugin but based on old framework.

On the market there is the so called pyObjC bridge which actually puts a bridge between Python and Objective-C giving therefor access to the Cocoa Framework lying under OSX.
The "old" CalendarStore is now included in the EventKit which provides access to Calendars, Events and Reminders.

Is the Indigo Server based on Python using this bridge or the access to Cocoa Framework is not needed?

I am a SW Developer so I am really interested on how this is done.

Thanks
Marco

Posted on
Fri Feb 26, 2016 3:18 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Access to Cocoa Framework

You can use the PyObjC bridge (which is included with Mac OS X) in your plugin if you like, just make sure you're not trying to access any UI elements since the IndigoPluginHost process that runs plugins doesn't have any UI. Not sure what would happen if you did, but it seems likely nothing good... ;)

I'm pretty sure (but not positive) that the 3rd party Cynical Calendars plugin uses the Calendar Store directly.

Note that there are two different uses of PyObjC - one is to call Python code from Objective-C, and the other is to call the SDK (Foundation, EventKit, etc) from Python. The latter is what I'm talking about. You can't start with an Xcode project that's set up to make a PyObjC app and use the Indigo module from it - the Indigo module can only be used in an IndigoPluginHost process. So, inside your plugin code, you can:

Code: Select all
import EventKit


Then use that to access the appropriate APIs. Don't ask me how - we don't use PyObjC so have no experience with it.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Feb 29, 2016 1:16 am
MarcoGT offline
Posts: 1091
Joined: Sep 11, 2014
Location: Germany

Re: Access to Cocoa Framework

Hi Jay,

thanks for the answer.
Yes, the idea is to do:

Code: Select all
import EventKit


I will give it a try :)
Thanks :)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests