04. Events [5:43]

Description: This video provides an overview of how to push and pull events between FileMaker and iCal using the iCal Manipulator.


In this video we will look at exchanging data between FileMaker and iCal.

0:04 Let’s begin with how to pull events from iCal into FileMaker. The functions used for this operation are: PCIM_EventsFetch to obtain a found set of events to import. The start date parameter will restrict events with a start date later than the start date. And the end date parameter will restrict events with an end date early than the end date. Calendars will restrict events belonging to the calendar named there. And UID is the UID for the specific event which is used if the event is a repeating event; GetItemCountForType will ensure that there are event records to import; OpenItemAt or OpenItemWithUID will open the event; And GetProperty gets the desired properties for the event.

0:58 Let’s have a look at these functions in our script. This is the demo file that comes bundled with the plug-in which you can download from our site. This button here is going to import all calendar events. Remember the EventsFetch function, that’s where these filter options come into play. I can choose a date range. Here in our demo file we auto populate these start and end times for you. Let’s choose last month. I’m going to leave the calendar filter options blank to import all events last month from all calendars. And before I select this button, I’m going to open up debugger, and let me just pull that down for a moment, select the Import All Events button, pull debugger back up here, and again I’ve set markers to identify all of the plug-in functions in the script. We’ll play down to our Events Fetch function. This is going to fetch events from all calendars within our specified date range which is last month as you can see her on the left. Next I’m going to get the item count for all events to ensure there are event records to import, and then we can begin opening all the events and getting all the specified properties. All available properties can be found in our functions guide. Play through here, since I have more than one event last month I’m going to remove our marker and just play through the script. Next, let’s close debugger and here I’ve imported 42 event records. Select the arrow button here to view the details of each event. I can see the type of calendar that their on and all of my properties. Here I can scroll through all of my events. Events add another layer in that each event can have recurrences as well as alarms. The importing of recurrence and alarm options are discussed in later videos.

2:52 Next let’s look at pushing an event from FileMaker into iCal. The functions used for this operation are: NewItem which creates the new item type. In this case the type is set to event; SetProperty which sets the desired property values; and SaveItem which saves the item.

3:18 Let’s look at these functions in our FileMaker script. Let’s select the Create New Event button in FileMaker to create our new generic FileMaker record. I’m going to assign this record to a calendar that I’ve already imported. How about our Test Calendar 1 that we created in the previous video. This video is not going to discuss recurrence or repeat options and alarms. We’re going to leave the recurrence and alarm options for a later video. Therefore I will not add these options to this event. Let’s go ahead and open up debugger and we’ll just rearrange these windows here so I push the Add/Update iCal button. And were actually going to play through to the first plug-in function call. Again I get the message if I would like to update my found set of records or the single record, just go ahead and select single. And in order to add a new event item to iCal, the first plug-in function call you will need is NewItem and the parameter is set to event. Next we are going to set all the properties which in this case are: title, isallday, enddate, startdatet, notes, you can get the list of available properties from the functions guide. And lastly we are going to save the item, exit the loop. It’s a good idea after you save the item to obtain the UID and the date stamp using the GetProperty function as shown here. Let’s play through this script, close debugger, and our event in FileMaker should now be populated with the UID and a date modified time stamp. If we would like to view the event in iCal, we’ve added a button here to open the event in iCal using some simple Apple scripting. Open that event in iCal and as you can see her is my Test Event 2.

5:18 I encourage you to explore all additional resources. Explore this website, review the videos and documentation, and download a demo. If you have additional questions please feel free to contact us via email, phone or browse our Forum for answers. We look forward to hearing from you and hope you enjoy connecting FileMaker and iCal.