Nisus Writer Express Macro
I realize that since Nisus Writer Express is a mac only word processor this request will not be a very high priority, but it would be nice if there were a macro for adding citations in zotero that worked for Nisus Writer Express.
What we really need, though, is a generic API and service for this function. It's silly that developers have to write dedicated code every different word-processor and bibliographic application! Citation formatting should be a system service in OS X.
However, if you can, have a look at the Word for Mac macro. The basic concept of that macro is that it calls Zotero using the VB command Macscript. I'm assuming that Nisus Writer Express macros (perl?) has the equivalent of a shell command to run OS commands. Using that you should be able run the command "osascript -e" and pass to it the same string that the macro builds. Alternatively I guess perl provides a HTTPREQUEST command. In OpenOffice I have used Pythons HTTPRequest as this works in all versions of OpenOffice.
The original macro uses Word fields and the name of the field to get the RTF formatted string back from Zotero. Instead of fields I have used bookmarks.
The original macro uses custom document properties for storing, the SessionID, the style of citation, whether that style is a note style, and whether to use footnotes or endnotes. As custom document properties don't round trip between OOo and MS Word I stored them as a string in the Document description.
I should be in a position to post my macros soon.
The Word and OOo code have the advantage that they share a lot. OOo, for example, handles VBA. I don't think the same is true of the other apps I list above.
Nor, BTW, is it true of Office 2008, which was just released, and does NOT support VBA. Hence, those of you who use Macs and Word, realize that Zotero won't work with 2008.
Once the core plugin code is ported to Python and uses an AppleScript bridge to talk to Word 2008 (which is what that ticket is about), it may be possible to talk to other AppleScript-aware applications by breaking out the word processor-specific functionality. So you might want to wait for that to happen before moving forward.
If Nisus doesn't have any sort of field/bookmark support equivalent to Word/OOo (and I don't see any mention of anything like that in its AppleScript dictionary, at least), it could be a bit harder/uglier whichever way this is implemented, though.
WRT to encoding the string/field in Cocoa, I think NSAttributedString might be useful, though I'd strongly, strongly recommend consulting the Nisus people.
Ideally, in fact, citation encoding and processing in OS X ought to be generic. I see no reason why every application ought to implement their own custom ways to do this. I've submitted an enhancement request to Apple to this effect, though I don't expect them to move on it. Better to push developers like Nisus, Omni, etc.
BTW, you might also look into how Mellel handles their citation API and encoding.
Is there a timeframe for the word08 plugin? How long do I have to wait before I have some python to crib :)
A Perl CSL processor would be called citeproc-perl and would be a topic for the XBib list, where just today the statuses of the various citeproc-* implementations (Ruby, Python, XSLT) were discussed. If you wanted to do that, you could port Zotero's JS-based processor to Perl. But that won't give you Nisus integration with Zotero. (Bruce's comment from last April might have thrown you off here.)
Nisus integration with Zotero would require porting today's VBA plugin or waiting for the Python plugin, but that has nothing to do with CSL. The Python plugin is probably a few months off.
I'd really like to see modules/libraries for this in different languages, and so really like your idea to be able to be able to drop it into a Catalyst project. But as Dan said that code is basically responsible for reading a CSL file, taking some input data, and outputting the formatting strings. The editor integration is really another chunk of code.
As Dan also said, if you want to explore this more, now would be a good time to join the xbib list particularly since there's someone that's just started on a PHP port that he wants to integrate with Drupal, and so is a similar kind of use case.
I think they have an API for citations, though I have no idea on the details.