The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Import iCal Events to OmniFocus Action Thread Tools Search this Thread Display Modes
Script that imports iCal Events into OmniFocus actions.
Useful for forecast mode and the satisfaction of checking off events as if they were actions.

Requirements:
iCal Buddy
http://hasseg.org/icalBuddy/

Tested in Lion. Still may have some bugs in it. Shouldn't do anything like delete important data. It will delete any action with the text
iCal UID:
in the note field.

Much gratitude and thanks to the following authors, developers, websites:

iCalBuddy: without which this script would not have worked.
http://hasseg.org/icalBuddy/

Other helpful resources:
http://hints.macworld.com/article.ph...91115201138792
http://macscripter.net/viewtopic.php?id=24737
http://www.latenightsw.com/sd4/index.html
http://growl.info/


Purpose:
This script takes events from the iCal calendars, and enters them as actions into the OmniFocus application.
The script will do the folling actions:
Create an OmniFocus action with the name of the iCal event as the action name.
Place the OmniFocus action into a single action project with the prefix: iCal- and add the calendar name. (iCal-Birthdays)
Assign the OmniFocus action a context with the same name as the single action project
Set the start date and end date of the OmniFocus action to the event start and end date.
Add a unique id in the note in the action with the prefix: "iCal UID:" + the iCal event uid + start & end date unique id.
Example: (iCal UID: 7F3952B2-BB97-492A-B501-1013A1E0D4AC:20119160201191886340)
This ID is what allows the script to connect an iCal event with an OmniFocus action. If you mess with this ID it will either be deleted by the script or never deleted.

The script relies on iCalBuddy to be run. You'll need to download it and install it
http://hasseg.org/icalBuddy/
Run the install.command file and follow the prompts in the terminal window.

The script only imports iCal events into OmniFocus actions. Changing any of the times on the actions will not do anything to iCal events. If you delete an OF action, and the iCal event is in the calendar,
the script will re-create the action.
Completing an OF action will remain completed. After the current time is beyond the action end time, the script is no longer checking that action.

The script will probably not perform as expected if you have two calendar's that are the same name.
The script will delete any OmniFocus action that has the characters
iCal UID:
in the note field.

After the single action projects and contexts have been created, you can move them wherever you want and they will stay there.

User bears all responsibility for running this script. Enjoy.

---10/09/2011
added functionality to use Growl 1.3 notifications
included helper script which copies the applescript to the users/library/scripts/applications/OmniFocus folder. This allows a user to right click on the toolbar, and add script to the OmniFocus toolbar

---Removed all other versions of the script. And uploaded the newest version to the top of the thread. The attachment below is the latest version.
Attached Files
File Type: zip iCalEventsToOmniFocus.zip (65.9 KB, 332 views)

Last edited by SpiralOcean; 2011-10-27 at 07:13 AM..
 
Fixed a bug in the script that would re-create the single action project at the root levels if the user had moved the project into a folder.

After the single-action project has been created by the script, you can move it and new actions will be created in that project. The same for contexts.

To modify the times for an action that is managed by this script, change the event in iCal. Any changes in iCal will change the OmniFocus actions as long as they are within the 7 day window for events.

Last edited by SpiralOcean; 2011-10-22 at 06:28 AM..
 
I am new to the forum and an IT dummy. I have just downloaded and run the script, and it shows an error message: 'invalid date and time date 09/30/11. - 30720.' This stopped the transfer of entries from iCal after the first 2. Can someone please advise as to what is going wrong? Thank you. PS I am in the UK, and I wonder if the dates are configured differently for UK users? I apologise if this is the wrong place to ask for this help.
 
I'll take a look at the iCalBuddy output.

If you run this applescript, it will place a file called:
iCalEventsToOmniFocusTroubleshooting.txt
on your desktop.

You can post the results here or send me a message with the results by clicking on my user name.

Last edited by SpiralOcean; 2011-10-09 at 06:02 PM..
 
---10/09/2011
added functionality to use Growl 1.3 notifications
included helper script which copies the applescript to the users/library/scripts/applications/OmniFocus folder. This allows a user to right click on the toolbar, and add script to the OmniFocus toolbar

Last edited by SpiralOcean; 2011-10-22 at 06:28 AM..
 
Quote:
Originally Posted by SpiralOcean View Post
I'll take a look at the iCalBuddy output.

If you run this applescript, it will place a file called:
iCalEventsToOmniFocusTroubleshooting.txt
on your desktop.

You can post the results here or send me a message with the results by clicking on my user name.
Thanks. Sorry, which script?

Ah, wait, I have the events log in the applescript editor. I will email the details. Thanks

Last edited by Simon Major; 2011-10-21 at 01:11 PM..
 
Hi all,

@SpiralOcean - Very useful script. Thanks a lot for sharing

@Simon Major: yes, it's a problem with the date format. You can make the script work by editing the one instance where the format is quoted in the script, thusly:

Right-click on the script, 'Show package contents', then navigate to Contents/Resources/Scripts/ and open main.scpt in the Applescript Editor. Change:

set shellScriptString to "/usr/local/bin/icalBuddy -ic \"" & calendarName & "\" -nc -nrd -eep \"url,location,notes\" -uid -df \"%m/%d/%y\" eventsToday+" & daysToLookAhead

to:

set shellScriptString to "/usr/local/bin/icalBuddy -ic \"" & calendarName & "\" -nc -nrd -eep \"url,location,notes\" -uid -df \"%d/%m/%y\" eventsToday+" & daysToLookAhead

There must be a more elegant way to fix this, but I don't know how...
 
I don't think this is a localization problem... I changed my date format and the script worked. I think it has to do with how the script is parsing out the text return from iCal.

For my machine there are 4 spaces in front of the date, the script was starting at position 4 to the end of the date to get the date. However, on Simon's machine, those spaces weren't there.

I've changed the script parsing a bit... Simon, give this one a shot and let me know if it works.

Last edited by SpiralOcean; 2011-10-23 at 07:10 AM..
 
Quote:
Originally Posted by SpiralOcean View Post
I don't think this is a localization problem... I changed my date format and the script worked. I think it has to do with how the script is parsing out the text return from iCal.

For my machine there are 4 spaces in front of the date, the script was starting at position 4 to the end of the date to get the date. However, on Simon's machine, those spaces weren't there.

I've changed the script parsing a bit... Simon, give this one a shot and let me know if it works.
Just tried the last version. Similar error to Simon: "Invalid date and time date 10/27/11. -30720". Am also in the UK too, btw.
 
Okay, so it probably is a localization thing...

This one should do the trick. Let me know if it doesn't work.

Also, Growl greatly enhances this script.
http://growl.info/

Last edited by SpiralOcean; 2011-10-27 at 07:13 AM..
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sync iCal events into OmniFocus SpiralOcean OmniFocus 1 for Mac 4 2012-04-16 10:35 AM
how to get iCal events into OF rllewis@mac.com iCal Sync 1 2011-05-02 02:42 PM
iCal import file freezes iCal w0rld OmniPlan General 4 2010-09-07 10:08 PM
Moving to OF from Palm/Missing Sync/ical - can I import from ical? Don Richmond OmniFocus 1 for Mac 6 2009-09-03 06:00 AM
Omnifocus 1.5.2 iCal Duplicate due events! Hitteam OmniFocus for iPhone 2 2009-07-22 07:58 PM


All times are GMT -8. The time now is 12:04 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.