05. Tasks [5:43]

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

Transcript:

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

0:04 Let’s begin with how to pull tasks from iCal into FileMaker. The functions used for this operation are: PCIM_TasksFetch – which obtains a found set of tasks to import, the calendars parameter specifies a list of calendar names to searched, the status parameter is a string indicating the type of task to be found either complete or incomplete, and the data parameter specifies tasks with either a due date before or after this date depending on the status; GetItemCountForType – insures that there are task records to import; OpenItemAt or OpenItemWithUID – opens the task; and GetProperty – gets the desired properties for the task.

0:58 – Let’s have a look at our demo to see these functions in action. This is the demo file available in the plug-in download on our site. This button here will import all tasks. My filter options here are being set by the TasksFetch function. This function has 3 parameters: one to specify the calendar, two to specify the status and three to specify the date. Let’s import all of the tasks from my work calendar. We will leave the status blank to import all complete and incomplete tasks. We’ll open debugger here, let’s adjust the windows here so I can select the import all tasks button, and we’ll play down to our first plug-in function call which is the TaskFetch function. The TaskFetch function allows us to obtain a found set of tasks to import. In this case I’m going to import all tasks from my work calendar. Now I’ve set my markers for each plug-in function so you can see them being used in this script. Let’s go ahead and run down to the GetItemCountForType function to ensure there are task records to import. We’ll enter our loop and begin opening each task and getting the property values for each task. Here we are gathering the UID, due date, is completed, etc. And a list of all available properties can be found in our functions guide. Play through the script, looks like I had 3 tasks that were found on my work calendar. Close debugger. In order to view the detail of each task, select view detail and here I can see all of my tasks and all of the properties for each task. We’ve added an Open in iCal button in our demo file using simple Apple scripting. This button will allow us to see the task in iCal.

2:53 Next let’s look at pushing a task from FileMaker into iCal. The functions used for this operation are: NewItem – which creates the new item type. In this case the type is task; SetProperty – which sets the desired property values; SaveItem – which saved the item. Let’s go to our demo to look at these functions in action. First I’m going to select the Create New Task button in order to create a task in FileMaker with some generic details. I’ll need to specify a calendar to add this task to. I’m going to specify the Test Calendar 1. Fill in my fields: Title, Due Date and others. Tasks also have the ability to add alarms. However; alarms will be discussed in a later video. Here you can note that I do not have a UID or a date modified, as this task does not exist in iCal. Once this task gets pushed to iCal we will get these two fields here. Let’s open debugger, change our windows around here so I can push the Add/Update iCal button, and let’s scroll down to the first plug-in function call which adds a new item. Our demo file has the ability to update a found set of records or a single record using a little more advance FileMaker scripting. I’m going to go ahead and select single to update this single record. The first plug-in function is NewItem, we specify the parameter as task to add the new task item. Next we will begin setting the properties for this task such as calendar title, title of the task, due date, is completed and a list of all properties can be found in our functions guide. Save item is going to save the task in iCal. Next we are going to get the date stamp and UID of the task in iCal. Let’s play through, close debugger and see that our task now has a UID and a date modified timestamp which we’ve retrieved from iCal. Here we can open the event in iCal for easy access and see that our new task does indeed exist in iCal.

5:18 I encourage you to use our additional resources for development. Explore this website, review the videos and documentation and reverse engineer our demo file. If you have additional questions please 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.