Testing wanted

41 views
Skip to first unread message

Simon

unread,
Feb 8, 2012, 5:43:22 PM2/8/12
to zotero-dev
Hi Zoterons,

We're getting ready to release Zotero 3.0.2 in the next few days.
Since I've restructured some word processor integration-related code,
it would be great to get some testing prior to release to ensure that
there aren't any major issues. The dev XPI is available at:

http://www.zotero.org/support/dev_builds#zotero_30_branch

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.

The new plugin does not work with Firefox 3.6, but it should be
forward-compatible with future Firefox versions without changes. It
also restores support for Mac OS X 10.5. The XPI is available at:

http://www.zotero.org/support/dev_builds#trunk

Thanks for your help in testing these upcoming releases.

Simon

Rönkkö Mikko

unread,
Feb 9, 2012, 2:57:43 PM2/9/12
to <zotero-dev@googlegroups.com>

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

Simon

unread,
Feb 10, 2012, 2:00:07 AM2/10/12
to zotero-dev
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');

Simon

Rönkkö Mikko

unread,
Feb 10, 2012, 2:14:28 AM2/10/12
to <zotero-dev@googlegroups.com>

On Feb 10, 2012, at 09:00, Simon wrote:

> 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.
>

Simon

unread,
Feb 10, 2012, 2:21:22 AM2/10/12
to zotero-dev
We just updated the XPI (before the changes were only on GitHub). Try
again.

On Feb 10, 2:14 am, Rönkkö Mikko <mikko.ron...@aalto.fi> wrote:
> On Feb 10, 2012, at 09:00, Simon wrote:
>
> > 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...

Rönkkö Mikko

unread,
Feb 10, 2012, 2:33:08 AM2/10/12
to <zotero-dev@googlegroups.com>

On Feb 10, 2012, at 09:21, Simon wrote:

> 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

Simon

unread,
Feb 10, 2012, 3:08:07 AM2/10/12
to zotero-dev
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.

Simon

Rönkkö Mikko

unread,
Feb 10, 2012, 3:16:42 AM2/10/12
to <zotero-dev@googlegroups.com>
On Feb 10, 2012, at 10:08, Simon wrote:

> 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

Simon

unread,
Feb 10, 2012, 3:49:54 AM2/10/12
to zotero-dev
On Feb 10, 3:16 am, Rönkkö Mikko <mikko.ron...@aalto.fi> wrote:
> On Feb 10, 2012, at 10:08, Simon wrote:
>
> > 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.

I don't think it's worth the effort to expose the code that generates
the scripts in Cocoa to JS, since it would take significantly more
code than the script itself. (js-ctypes really sucks sometimes,
particularly when dealing with strings.)

Simon

Rönkkö Mikko

unread,
Feb 10, 2012, 4:57:31 AM2/10/12
to <zotero-dev@googlegroups.com>
For some reason I cannot get this to work. Installing the example script given by Simon works well, but installing a multiline script fails with an error from osacompile (compilation error: Expected expression but found unknown token. (-2741)).

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

Simon

unread,
Feb 10, 2012, 11:35:15 AM2/10/12
to zotero-dev
You need to escape your backslashes; right now that string is not
valid AppleScript. You could just copy/paste from
https://github.com/zotero/zotero-word-for-mac-integration/blob/master/build/src/install.m#L365
and add some + signs.

Simon

On Feb 10, 4:57 am, Rönkkö Mikko <mikko.ron...@aalto.fi> wrote:
> For some reason I cannot get this to work. Installing the example script given by Simon works well, but installing a multiline script fails with an error from osacompile (compilation error: Expected expression but found unknown token. (-2741)).
>
> 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...(lines 102-110)

Frank Bennett

unread,
Feb 12, 2012, 6:33:45 AM2/12/12
to zotero-dev
I'm able to crash the 3.0.2 release predictably under Linux.

STR:

(1) Fire up Zotero 3.0.2 with Zotero OpenOffice Integration 3.5.2
under Ubuntu 11.04 w/Gnome window manager.
(2) Fire up lowriter ver. 3.3.4.
(3) Click on Set Document Preferences in lowriter
(4) Click on (x) in window manager to cancel Set Document Preferences
popup.
(5) Firefox crashes.

I've tried to trace some values, but haven't hit anything that looks
like a cause.

Frank


On Feb 10, 4:35 pm, Simon <si...@simonster.com> wrote:
> You need to escape your backslashes; right now that string is not
> valid AppleScript. You could just copy/paste fromhttps://github.com/zotero/zotero-word-for-mac-integration/blob/master...
> and add some + signs.
>
> Simon
>
> On Feb 10, 4:57 am, Rönkkö Mikko <mikko.ron...@aalto.fi> wrote:
>
>
>
>
>
>
>
> > For some reason I cannot get this to work. Installing the example script given by Simon works well, but installing a multiline script fails with an error from osacompile (compilation error: Expected expression but found unknown token. (-2741)).
>
> > 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...102-110)
Message has been deleted

Simon

unread,
Feb 12, 2012, 2:55:16 PM2/12/12
to zotero-dev
Huh, that's really weird. It's not actually crashing; it's closing on
its own, as if the last window was closed. If you have two Firefox
windows open, then it doesn't close immediately, but it does close
after you close one of the remaining windows. I'll look into the cause
of this.
> > >https://github.com/mronkko/ZoteroQuickLook/blob/master/chrome/content...)

Simon

unread,
Feb 12, 2012, 7:06:39 PM2/12/12
to zotero-dev
Not sure what the underlying issue was, but this should be fixed now
(via making the close button and cancel button do exactly the same
thing). It looks like it's been a problem since at least 3.0.1.

Simon

Frank Bennett

unread,
Feb 12, 2012, 7:25:04 PM2/12/12
to zotero-dev
On Feb 13, 12:06 am, Simon <si...@simonster.com> wrote:
> Not sure what the underlying issue was, but this should be fixed now
> (via making the close button and cancel button do exactly the same
> thing). It looks like it's been a problem since at least 3.0.1.
>
> Simon

That was quick! There's a small thing with focus, I don't know whether
it's worth worrying about. When Firefox is started, followed by
lowriter, the Document Preferences come up underneath the Writer
window, and refuses to foreground. The only way to get access to it is
by reducing or moving the Writer window. After the popup is cancelled
once, it comes to foreground properly when it first appears.

Frank

Simon

unread,
Feb 12, 2012, 7:50:29 PM2/12/12
to zotero-dev
On Feb 12, 7:25 pm, Frank Bennett <biercena...@gmail.com> wrote:
> On Feb 13, 12:06 am, Simon <si...@simonster.com> wrote:
>
> > Not sure what the underlying issue was, but this should be fixed now
> > (via making the close button and cancel button do exactly the same
> > thing). It looks like it's been a problem since at least 3.0.1.
>
> > Simon
>
> That was quick! There's a small thing with focus, I don't know whether
> it's worth worrying about. When Firefox is started, followed by
> lowriter, the Document Preferences come up underneath the Writer
> window, and refuses to foreground. The only way to get access to it is
> by reducing or moving the Writer window. After the popup is cancelled
> once, it comes to foreground properly when it first appears.

Can you generate a debug ID? I'm not reproducing this on what should
be a similar config.

Simon

Frank Bennett

unread,
Feb 12, 2012, 8:45:10 PM2/12/12
to zotero-dev
It seems to play hide-and-seek only if no popup has yet been
activated; I had to use Enable After Restart to get the steps into a
debug report.

The Debug ID is D1651152026.

The steps reflected in the report are:

- Starting lowriter
- Clicking Set Document Preferences
- Clicking the Document Preferences tab (in the running windows ribbon
at the bottom of Gnome display)
- This jumped to Firefox in a separate desktop area, so I reselected
the area with lowriter running
- Minimizing lowriter
- Cancelling the popup
- Maximizing lowriter again
- Clicking Document Preferences again, to get the popup foregrounded
over lowriter.
- Cancelling the popup again.

Frank

Simon

unread,
Feb 12, 2012, 10:45:25 PM2/12/12
to zotero-dev
I tried these same steps and I'm not seeing any issues in my VM (with
Ubuntu 11.04, GNOME, and Metacity). Does the issue also occur if you
run Firefox and LO in the same desktop?

Simon

Frank Bennett

unread,
Feb 13, 2012, 3:01:18 AM2/13/12
to zotero-dev
I've done some more clicking around, and even if it's not just my
system, it's a very narrow and specific glitch.

Here are the constraints:

- The initially backgrounded DocPrefs popup will refuse to foreground
only if started on a different desktop than FF.
- The popup will start backgrounded only when LO is started from a
terminal command line, as "lowriter" (not from a launcher).
- The popup will start backgrounded only if Zotero is set to run as a
panel (not as a tab or app tab), is not showing in FF, and has not
been run since FF was started.

If any of those starting conditions vary, things work normally.

Frank

Frank Bennett

unread,
Feb 14, 2012, 10:05:45 PM2/14/12
to zotero-dev
Found another crash condition. I think this may have been reported to
the forums as well, but here goes.

STR:

(1) Run Zotero w/LibreOffice integration.
(2) Set to use Classic integration popup by default.
(3) Run LibreOffice Writer.
(4) Click Insert Citation icon.
(5) Select a style.
(6) When the Classic dialog appears, use (x) to cancel it.
(7) Integration crashes with Java error trace, after which it is
inoperative until FF restart.

I've filed a Debug ID report covering steps (4) - (7): D1835310248

Report was done with a GitHub checkout of the current 3.0 branch.

Frank
Reply all
Reply to author
Forward
0 new messages