> We're also preparing for the release of a new, completely rewritten
> Zotero MacWord Integration plugin. The new plugin uses js-ctypes
> combined with Scripting Bridge to interface with Word. This replaces
> the old appscript/PythonExt-based plugin. The sweeping architectural
> change was necessary for two reasons. First, Firefox 11 lacks the
> ability to create custom module loaders, which broke PyXPCOM and thus
> PythonExt. Additionally, appscript relied on APIs that have been
> deprecated in Mac OS X 10.7, and has been discontinued.
Does this new plugin publish interfaces that third party plugins could use to install scripts in the Word script directory? I introduce a script menu item in ZoteroQuickLook 1.3, but the path where it is installed is currently hard coded. Using the same installer as the MacWord plugin would enable supporting scripts in more than one location.
Mikko
> You should now be able to do:
>
> var installer = Components.classes["@zotero.org/Zotero/integration/
> installer?agent=MacWord;
> 1"].createInstance(Components.interfaces.nsIRunnable).wrappedJSObject;
> installer.writeScript(installer.getScriptItemsDirectory()+"/My
> Script.scpt", 'tell application "Finder" to activate');
This does not seem to work
*** WARN addons.manager: Exception calling callback: TypeError: installer is undefined
The code is available here
https://github.com/mronkko/ZoteroQuickLook/blob/master/chrome/content/zoteroquicklook.js
Lines 104-105 are the relevant parts.
Mikko
>
> Simon
>
> On Feb 9, 2:57 pm, Rönkkö Mikko <mikko.ron...@aalto.fi> wrote:
>> On Feb 9, 2012, at 00:43, Simon wrote:
>>
>>> We're also preparing for the release of a new, completely rewritten
>>> Zotero MacWord Integration plugin. The new plugin uses js-ctypes
>>> combined with Scripting Bridge to interface with Word. This replaces
>>> the old appscript/PythonExt-based plugin. The sweeping architectural
>>> change was necessary for two reasons. First, Firefox 11 lacks the
>>> ability to create custom module loaders, which broke PyXPCOM and thus
>>> PythonExt. Additionally, appscript relied on APIs that have been
>>> deprecated in Mac OS X 10.7, and has been discontinued.
>>
>> Does this new plugin publish interfaces that third party plugins could use to install scripts in the Word script directory? I introduce a script menu item in ZoteroQuickLook 1.3, but the path where it is installed is currently hard coded. Using the same installer as the MacWord plugin would enable supporting scripts in more than one location.
>>
>> Mikko
>
> --
> You received this message because you are subscribed to the Google Groups "zotero-dev" group.
> To post to this group, send email to zoter...@googlegroups.com.
> To unsubscribe from this group, send email to zotero-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/zotero-dev?hl=en.
>
> We just updated the XPI (before the changes were only on GitHub). Try
> again.
This works now just fine.
There is one small thing that I would like changed, but this is not very important. There could be an additional parameter to the writeScript method that tells the name of the product that is being installed. When I use the installer from ZoteroQuickLook I would like the dialogs that the installer may show to say that ZoteroQuickLook integration is being installed instead of MacWord integration.
Mikko
> The writeScript() method doesn't show any dialogs. It just calls
> osacompile with the appropriate OS version-specific arguments. The
> getScriptItemsDirectory() method potentially shows a dialog that says
> "Select the Word Script Menu Items folder, usually located in
> Documents/Microsoft User Data," which is agnostic.
I see. It seems that I confused the installer dialog for the integration to installing the ZoteroQuickLook integration.
Is the script that generates the content of the integration scripts exposed outside the integration? I saw this in the XCode project, but do not know if it can be accessed outside he MacWord integration?
Basically, I want to generate the following script:
try
do shell script "PIPE=\"/Users/Shared/.zoteroIntegrationPipe_$LOGNAME\"; if [ ! -e \"$PIPE\" ]; then PIPE='~/.zoteroIntegrationPipe'; fi; if [ -e \"$PIPE\" ]; then echo 'MacWord2008 quickLook '" & quoted form of POSIX path of (path to current application) & " > \"$PIPE\"; else exit 1; fi;"
on error
display alert "Word could not communicate with Zotero. Please ensure that Firefox is open and try again." as critical
end try
The only difference between this and the integration scripts is the command that it sends to Zotero.
Mikko
var installer = Components.classes["@zotero.org/Zotero/integration/installer?agent=MacWord;1"].createInstance(Components.interfaces.nsIRunnable).wrappedJSObject;
installer.writeScript(installer.getScriptItemsDirectory()+"/Zotero/ZoteroQuickLook\\coq.scpt",
'try\n'+
'do shell script "PIPE=\"/Users/Shared/.zoteroIntegrationPipe_$LOGNAME\"; if [ ! -e \"$PIPE\" ]; then PIPE=\'~/.zoteroIntegrationPipe\'; fi; if [ -e \"$PIPE\" ]; then echo \'MacWord2008 quickLook \'" & quoted form of POSIX path of (path to current application) & " > \"$PIPE\"; else exit 1; fi;"\n'+
'on error\n'+
'display alert "Word could not communicate with Zotero. Please ensure that Firefox is open and try again." as critical\n'+
'end try\n');
https://github.com/mronkko/ZoteroQuickLook/blob/master/chrome/content/zoteroquicklook.js (lines 102-110)
Mikko