View Single Post
how much trouble would it be to modify this script to also include the context in the item's title?
Oh, I suppose not all that much trouble. Did you try adding it yourself? Really, AppleScript is a pretty easy language to just fiddle around in. I strongly encourage anybody using this script to at least open it up once and look around inside.

I admit it's much easier to delete or change scripts than to add things to them.
So here's version 2.2: it includes the context by default, and now has "wantContext" and "wantProject" properties, so users can easily turn those parts of the ToDo title on or off by just editing the properties at the top of the script.

[carefully checks for unwanted debugging code left behind]

[has a brainstorm]

Oh, for crying out loud. You people have got to stop making me fiddle with this script. I keep thinking of new things to add. I have also added rudimentary 'completion' synchronization.

Until now, if the script found an existing ToDo item in iCal with the same name as the one it's trying to sync, it would delete the old ToDo before building the new one coming over from iCal. (This is especially important if you're syncing all flagged items.) Now, if it finds a matching existing ToDo, AND that ToDo item has been checked off, then instead of deleting/recreating it from OF, it will instead check off the task in OF as "completed."

A warning: this is done (somewhat imprecisely) by looking for a ToDo item in iCal that contains the title of the OF Task. (Because the iCal ToDo title has that project and context stuff in it too). If you have a task called "Buy Groceries at Safeway" and one called "Buy Groceries", the latter might mis-match to the former and delete/replace it.

One way to avoid this would be to use the URL of the iCal ToDo item to be able to uniquely identify which OF item it originally came from. But that would involve increasing the size of the script by 50% or so, and since I'm not actually using this script, I think I'll skip that function for now. Maybe when version 2.3 comes out . . . :cool:

Also, it'll only sync the 'completion' flag if you check it off in iCal, then highlight it in OF to copy it into iCal again. Or if it's flagged, and you're syncing flagged items.

But hey, it's a free bonus feature. Maybe somebody else would like to improve upon it a bit? {rueful chuckle}
Attached Files
File Type: zip tasks to iCal (31.1 KB, 280 views)