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

 
Parse & paste Lotus Notes Doclink into OmniFocus action note Thread Tools Search this Thread Display Modes
I now have several of my friends hooked on OF. Unfortunately we all work at a company that uses Lotus Notes for email. The problem is not Lotus Notes (it works fine). It is that we need a way to tie our Lotus Notes email and teamroom documents into OF. There is a way that we see to do this but I think it needs some Applescript or smarts built into OF to handle it right.

Notes has a concept of a Doclink. It is a way for the Notes client to copy link to an existing document and paste it into a text field in another document. It works great within Notes and some other applications also understand what do to with Doclinks in their app. Mindjet Mindmanager is a good example of this. We would like OF to take the Doclink off the OS X clipboard and paste it into note field of the action.

Today if you paste it into the note field in an Action, it will look like this:

Will's Mail - OmniFocus & Lotus Notes
<NDL>
<REPLICA 852370F9:00757C27>
<VIEW OF37D46BF5:E8F08834-ON852564B5:00129B2C>
<NOTE OF877C97B2:1462232F-ON862573A2:0066B1EE>
<HINT>CN=ServerA/O=MyOrg</HINT>
<REM>Database 'Will's Mail', View 'Inbox', Document 'OmniFocus & Lotus Notes'</REM>
</NDL>

Contained within that text is enough information to construct a Notes URL that OF and most browsers understand. That URL for the above link would look like this:

Notes:///852370F900757C27/37D46BF5E8F08834852564B500129B2C/877C97B21462232F862573A20066B1EE

After the "Notes://" the rest of the information is pulled from the REPLICA, VIEW and NOTE lines above. You strip out the ":" that appear in the line and for the VIEW and NOTE lines, you pull leading "OF" and "-ON" halfway through the string. Take those results and separate them by a slash "/" and you are done. OF will properly launch that URL from within the note field in the action.

If we had the Notes URL instead of the doclink text, we could tie our actions back to Lotus Notes via the link that we could click on.

Other info like the source (Will's mail inbox) and email title (OmniFocus & Lotus Notes) are there for the taking as well.

So our plea is can someone who knows Applescript can give us a script that parses what is on the clipboard, opens a new action and pastes in a usable Notes URL (Notes://). This would help OF by providing a great tie to Lotus Notes and make it easier to leverage that user base. All Mac Lotus Notes users could then use OF to manage both their work life (mostly in Lotus Notes) and personal stuff.

Of course if Omni could do the parse on the paste like Mindjet, that would be even cooler.

Any takers to help out there?

Last edited by WillR; 2007-12-03 at 10:24 AM..
 
I, too, work for a company who's centered most of its business -- and business processes -- on Lotus Notes. We also have a rising population of Mac users who are GTD converts and are anxiously awaiting the shipment of OmniFocus.

I can't think of a more innovative integration point than what WillR describes above. Please...someone jump on this one!
 
Does Notes support Mac OS X Services? If you select text in Notes and use the clipping shortcut, does anything happen?
__________________
CTO, The Omni Group
 
Apparently Notes doesn't support Mac OS X Services since all it does is beep at me. If I try the keystroke from other applications, it works fine. :-(
 
I have this working fairly well here. Thanks for ChuckieMac for his "cutof" URL handler app/script, and curt.clifton for help with modifying the script.

I think there are a half dozen ways to do this, and this probably isn't the best - but it's the first one that I got working. :-)

I'm using Notes 7.0.2 on Mac OS X 10.4.11. Firefox is my default browser.

1) go here, download the .dmg, and follow all the instructions for creating a bookmarklet. See here for the origins of this app.

2) Due to some changes in the OmniFocus script support, we need make a change/fix to ChuckieMac's script. In Finder, go to Applications, and right-click on Copy URL to OmniFocus. Choose "Display Contents", and navigate further to Contents/Resources/Scripts. Open main.scpt in Script Editor. Replace the 'tell application "OmniFocus"' section in the middle with the following:

Code:
tell application "OmniFocus"		
	tell quick entry
		activate
		set newTask to make new inbox task with properties {name:("capture: " & theTitle), note:theAddress}
		select {inbox task 1}
	end tell
	-- to capture without using the Quick Entry dialog, use this code instead:
	--tell default document
	--	make new inbox task with properties {name:("capture: " & theTitle), note:theAddress}
	--end tell

end tell
At this point you will have a bookmarklet in firefox, and your Mac will be configured to use ChuckieMac's app/script to create OmniFocus actions in response to "cutof" URL clicks.

3) In Lotus Notes, select from the Lotus Notes menu, "Preferences -> Toolbar Preferences". Select "Customize" on the left. Select New -> Button. Fill in the following:

- Button caption text: "capture to omnifocus"
- Select a suitable icon (choose a small one. I'm not thrilled with any of them - I chose the pointy-finger pointing at the globe).
- enter the following code for the formula, then click the Checkmark and OK. Do whatever else is necessary so that the new button appears where you desire on your Notes toolbar. Associate a hotkey if you can and desire - I'd like to do this as well, but I haven't.
Code:
serverNameAbb := @Name([Abbreviate];@Subset(@DbName;1));

serverNameCommon := @Name([CN];@Subset(@DbName;1));

serverDNSName := @DbLookup(""; "":"names.nsf"; "Connections"; serverNameAbb; "OptionalNetworkAddress"; [FailSilent]);

REM {For server names that contain spaces, always use the DNS name instead, because notes:// links do not work when the server name contains spaces.};

serverNameCommon := @If( @Contains(serverNameCommon;" "); serverDNSName; serverNameCommon );

REM {Database, View and Document url links.};

urlDatabase := @LowerCase( "notes://" + @URLEncode("Domino";serverNameCommon) + "/" + @WebDbName );

urlView := @LowerCase( urlDatabase + "/" + @URLEncode("Domino";@Subset(@ViewTitle;-1)) );

urlDocument := @LowerCase( urlDatabase + "/0/" + @Text(@DocumentUniqueID) );

serverNameCommonEncoded := @URLEncode("Domino";@LowerCase(serverNameCommon));

urlDatabaseDNS := @ReplaceSubstring(urlDatabase; serverNameCommonEncoded; serverDNSName);

urlViewDNS := @ReplaceSubstring(urlView; serverNameCommonEncoded; serverDNSName);

urlDocumentDNS := @ReplaceSubstring(urlDocument; serverNameCommonEncoded;serverDNSName);

REM {Additional text to appear in the dialog box.};

databaseTitle := @Subset(@DbTitle;1);

documentTitle := @If( Title != ""; Title; Subject != ""; Subject; databaseTitle);

REM {Dialog Box messages};

dialogTitle := "Lotus Notes URL";

dialogMessage := "Press Ctrl-C to copy this URL.";

REM {Choices to appear in Dialog Box};

dialogChoices :=

@Unique(@Trim(

@If( Form=""; "";

("(doc) " + documentTitle + " - " + urlDocument) ) :
(urlDocument) :

("(db) " + databaseTitle + " - " + urlDatabase) :
(urlDatabase) :

("(view) " + databaseTitle + " - " + urlView) :
(urlView) :

@If( Form=""; ""; ("(doc) " + documentTitle + " - " + urlDocumentDNS) ) :

("(db) " + databaseTitle + " - " + urlDatabaseDNS) :

("(view) " + databaseTitle + " - " + urlViewDNS)

));

REM {Display the Dialog Box};

REM {@Prompt([OkCancelEditCombo]; dialogTitle; dialogMessage; @Subset(dialogChoices;1); dialogChoices)};

@URLOpen("cutof://===="+urlDocument+"===="+documentTitle)
- note: the preceeding code was originally written to present a dialog, with choices for Notes DB, View, and document - the selected choice could be copied to the clipboard. If this is desired you can un-comment the appropriate lines in the script and get rid of the OpenURL line.
- Also, I have tried to find the original author who freely contributed this script so I can give them credit, but I couldn't find them. I will credit him/her when I determine who the author was.

If everything went right, clicking on the new toolbar button should bring up the OF Quick Entry window with a new task. Command-apostrophe should open the Content of the task, and a notes: URL should be there.

One slightly annoying thing is that when you click the icon, Firefox (if it is your default browser) is launched and a blank page appears - web browser is launched, and the web browser in turn launches the script.

Last edited by fudster; 2007-12-03 at 08:38 PM..
 
Thanks fudster. It took a bit of juggling but I got it working. A little Applescript training for me I guess. I used your instructions but had to make a change to the OF section. I used this instead:

tell front document of application "OmniFocus"
make new inbox task with properties {name:("capture: " & theTitle), note:theAddress}
end tell

I would still like see tighter linkage with OF understanding and parsing a Notes DocLink but this will work for me. I am off to organize my Notes life.

Thanks again for the help.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone using Lotus Notes 8.5 with OmniFocus? convergent OmniFocus 1 for Mac 11 2013-10-10 03:07 AM
Lotus notes on windows Xraptorx OmniFocus for iPad 1 2012-08-21 03:35 PM
Paste and Match Style not working in an Action's notes Rockyroad OmniFocus 1 for Mac 23 2011-03-03 01:12 PM
Transferring action items from meeting notes to omnifocus Rutilate Applying OmniFocus 8 2010-10-27 04:49 AM
Android/Lotus Notes Sync? Sartori OmniFocus Syncing 3 2010-02-25 05:50 AM


All times are GMT -8. The time now is 12:59 AM.


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