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 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Syncing Agendas to Address Book via Applescript Thread Tools Search this Thread Display Modes
T minus 10 days until the iPhone drops, and I'm hacking some scripts to help me take advantage of its functionality. I have an AJAX version of OmniFocus Mobile waiting in the wings, but I'm hoping to find a replacement for ACGI Dispatcher before posting it. Stay tuned.

In the mean time, I whipped up a script to sync agenda items to their respective contact records' notes. To install:
  1. Uncompress and drop the attached script into ~/Library/Scripts/Applications/OmniFocus
  2. Right-click the toolbar, select "Customize Toolbar..." and drag the script to the toolbar.

The script assumes a top-level context called @Agendas, and sub-contexts for contacts in your address book. Click the "Sync Agendas" button on the toolbar, and it will add agenda items as a bulleted list in the contacts' notes. When you sync your iPhone, these notes should (in theory) be transferred to the device.

A few final notes:
  • You don't need a context for each contact in your address book, nor do you need an address book contact for each agenda sub-context. It only syncs when it finds a match.
  • The spelling of the contact's name be exactly the same.
  • It does not sync both ways. Removing a line from the address book notes will not mark the associated task as completed.
  • Don't want to sync manually? Set up a cron job.

Enjoy!
Attached Files
File Type: zip Agenda Sync.scpt.zip (34.2 KB, 451 views)

Last edited by dansays; 2007-06-19 at 10:13 AM..
 
Could you post some screenshots? Where does it write it in the address book?

BZ
 
It appends the list to the notes, like so:

 
How does it deal with things that were removed or updated?

What does it do if there were things already in the note field?

BTW: This is VERY COOL!

BZ
 
After a match is found, the script removes any lines that start with a bullet point, and then appends the bulleted list to the end of the notes field. It leaves existing notes alone, and removes actions that have since been marked as complete.
 
Now if only OmniFocus could support a URL type... then you could turn the notes in AddressBook into clickable links!

And for safety, could you have an "@Agenda" text line before the bullet points, then only delete bullets that appear after that line? I already use bullet points for things like
  • Favourite dish is my "Vegetables Au Gratin #5" with any baked chicken
  • Loves cyclamen, hates roses
  • Picky about beef (ethical reasons), stick to other (organic) meats
  • ALLERGIC TO PEANUTS, tree nuts okay

I'd hate to lose these notes when syncing agenda items... sure it's important to remember that I promised to buy her some washers and help fix her leaking tap. But then I'll end up buying roses and cooking a (feed-lot) beef satay on our next date and ruin everything...

Don't worry, it's a contrived example.

If the list was maniplated to become:
  • Favourite dish is my "Vegetables Au Gratin #5" with any baked chicken
  • Loves cyclamen, hates roses
  • Picky about beef (ethical reasons), stick to other (organic) meats
  • ALLERGIC TO PEANUTS, tree nuts okay
@Agenda
  • Get ring size
  • What is her favourite precious stone?

Then my attempts to woo should be far less deadly ;)

Again, it's a contrived example. But I'm starting to use my calendar and address book more and more as a contact management system, it would be nice if other software I use doesn't clobber my hard work :\

Of course, this would make a nice weekend project for me, going through those AppleScripts and solving the problem for myself!

edit: oops... looks like I misread the original comment - you're saying that it only deletes bullet points after a bullet item matching an existing OmniFocus task is found? I can work with that, I guess...
 
Quote:
Originally Posted by Grail
edit: oops... looks like I misread the original comment - you're saying that it only deletes bullet points after a bullet item matching an existing OmniFocus task is found? I can work with that, I guess...
This is not the way the script works. It destroys anything with a bullet (option-8) as the first character, then appends the current list of agenda items to the end.

Quote:
Originally Posted by Grail
Now if only OmniFocus could support a URL type... then you could turn the notes in AddressBook into clickable links!
Sadly, address book notes don't support rich text or hyperlinks. I think the real value of agenda items embedded in contact notes will come when my address book is routinely sync'd to my phone, and linking back to the OmniFocus action is irrelevant in that context.

Your point about existing bullet points is well taken, however. I tweaked the script to use a unicode checkmark symbol, rather than the bullet point. Since the checkmark isn't reproducible via a keyboard shortcut, it's fairly safe to use it as a unique delimiter.

Plus, it looks cooler. :-D
Attached Files
File Type: zip Agenda Sync.scpt.zip (34.5 KB, 444 views)

Last edited by dansays; 2007-06-20 at 06:59 PM..
 
Now, to talk with Omni about bundling your $cript, and your con$ulting rate$...

Thanks!
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Address Book integration bcalloway OmniFocus 1 for Mac 5 2010-09-09 03:39 PM
Link to Address Book Mixalis OmniFocus 1 for Mac 5 2009-09-29 08:22 PM
Moving Address Book from 10.4.11 to 10.5.6 Bart Omni Lounge 6 2009-06-25 08:16 AM
Address Book Collection rbl OmniWeb General 1 2008-06-17 08:44 AM
address book tbrock OmniFocus Extras 0 2008-02-01 09:58 AM


All times are GMT -8. The time now is 09:33 PM.


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