View Single Post
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..