New plugin: ZoteroQuickLook
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
Another thing: A lot of people in this thread have posted fixes to the plugin. I would be more than happy to take co-maintainers for this plugin, so please email me mikko.ronkko@tkk.fi if interested.
Regret that I cannot contribute code. Will stay tuned. Thanks for a great plugin.
kithairon
Something like this
find [path] -name "filename.pdf" -exec /usr/bin/qlmanage -p {} \;
This can be called directly or through a shell script.
http://www.tkk.fi/u/mronkko/zoteroquicklook.xpi
Changes include
* On Linux and Mac quick look is called through a perl script that resolves wildcards in file names. This solves the problem with non-ascii characters in file names
* The default behavior on Windows is now to look for MaComfort and use that if it is available.
Currently there is no support for non-ascii characters in file names on Windows. If someone is willing to port the perl script as Windows shell script, then support will be added.
Please report test results here. If no major bugs are found, I will make a new release through the mozilla extensions site.
Any ideas? Thanks.
kithairon.
OSX 10.6.6 / FF 3.6.6 /Zotero 2.03 / ZQL 0.2.0
Meanwhile, I will try to figure out to way to get the permissions correct on install.
kithairon
Here's the error message:
[JavaScript Error: "uncaught exception: [Exception... "Component returned failure code: 0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) [nsIProcess.init]" nsresult: "0x80520006 (NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)" location: "JS frame :: chrome://zoteroquicklook/content/zoteroquicklook.js :: anonymous :: line 150" data: no]"]
New version is available at http://www.tkk.fi/u/mronkko/zoteroquicklook.xpi
One condition seems to be that the Zotero entry and the file-name are identical (for both pdf and html-webshots alike); when they are not ZQL brings up the generic white icon. In most cases the pdf-title and the Zotero entry are identical but in a number of cases they are not (one entry has several pdfs or an added webshot) and the latter (by Zotero default) take as title the title of the source webpage. Is it possible to let ZQL open html and pdf objects without their filename having to be identical with the name of the Zotero entry they are filed under?
Example of step-by-step instructions:
-search "test" on google scholar
-import the second item
-choose the item (not attachement) and press space
In FF:
-Go to URL: http://forums.zotero.org/categories/
-Create snapshot in Zotero („new entry from current page“)
-Find new entry in Zotero center pane („Zotero Forums - Categories“)
-Select snapshot contained in above entry (same title as entry „Zotero Forums - Categories“)
Invoke ZQL (via spacebar or contextual menu-item „Quicklook“)
[Would expect ZQL to open the html-file but nothing happens]
Checking the title of the actual html-file (not the title of the snapshot in Zotero’s center pane) with the „Show file“-button: Zotero will open one of its folders with a file called „Categories.html“
-Going back to Zotero’s center pane and select above snapshot („Zotero Forums - Categories“)
-Use contextual menu „Rename file with metadata“ (this adds „.html“ to the title visible in Zotero’s center pane); „Show File“ in right pane reveals that the actual file name has now changed from „Categories.html“ to „Zotero Forums - Categories.html“ i.e. it is now identical (a) to name of main entry in center pane (b) to name of snapshot contained in main entry.
-Invoke ZQL: (via spacebar or contextual menu-item „Quicklook“)
[all is well ZQL: shows up and displays the html-snapshot as expected]
Something similar happens with pdfs: if main entry (in central pane) and the title of file attached are identical (in Zotero's storage subfolders) ZQL displays them; if they are different (as maybe the case if one entry has many attached pdfs with differing titles and filenames) they are not being displayed with ZQL.
If manually changed (with the contextual menu's "Rename file with main entry's metadata") ZQL displays them again.
It would be good if ZQL could display html and pdf files that have different names from a main entry in Zotero.
Hope this is detailed enough for you to make sense of. (Im using a non-english setup and have to retranslate Zot's menupoints.)
http://www.youtube.com/watch?v=Yrdjcstjh30&feature=youtube_gdata
The crux seems to be that in my normal setup I use a specified directory for Zotero's storage, differing from the default setting in FF's profile. If I set this back to the Zotero default in the 'Advanced'-tab in the Zotero's preferences (i.e. to the FF profile) then all seems to work fine. (Maybe it is possible for ZQL to allow for a customized storage-folder?) Sorry for misleading you with parts of my post above.
Try to switch debug on and debug level to three (extensions.zotero.debug.level) and run Firefox from command line.
(see http://www.zotero.org/support/debug_output)
You should get something like this in the console:
zotero(3)(+0001970): ZoteroQuickLook active
zotero(3)(+0000000): ZoteroQuickLook opening viewer
zotero(3)(+0000001): ZoteroQuickLook calling a shell command: /Users/mronkko/Library/Application Support/Firefox/Profiles/l5auep3s.Mikko/extensions/zoteroquicklook@gmail.com/chrome/content/zoteroquicklook.pl /Users/mronkko/Documents/Research/Zotero Data/storage/H5KD9I24/categories.html
Testing Quick Look preview with files:
/Users/mronkko/Documents/Research/Zotero Data/storage/H5KD9I24/categories.html
Post what you get when the plugin does not work.
http://www.tkk.fi/u/mronkko/zoteroquicklook.xpi
Changes include:
-Fixed the permissions problem on Mac and Linux
-QuickLook is now enabled for the insert citation dialog as well. (With space bar as the keyboard shortcut)
I get this error message:
"C:Program FilesmaComfortmaComfort.exe is missing. Please install MaComfort into this directory or spesify a custom view command instead."
I thought it was a problem with escape char (backslash) but it does not work even if I change the line 80 of zoteroquicklook.js :
file.initWithPath("C:\\Program Files\\maComfort\\maComfort.exe");
Strange...
2) Even for Windows?
EDIT for 2) : even for Windows seemingly... (but problem 1) remains)
Works for me in Ubuntu now. Only thing that doesn't work is using spacebar in Zotero itself - it works in the Ooo plugin. I don't need it, but I'm happy to help troubleshoot if you're interested. Let me know what you need.
Here the debug output for two instances the plugin only brings up the generic icon with no text from two freshly created websnapshots - the path to my Zotero storage is my usual (Users/amw/Documents/Zettelbank/Zotero/storage):
2010.07.08 17:06:13 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
2010.07.08 17:06:13 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook opening viewer
2010.07.08 17:06:13 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook calling a shell command: /usr/bin/perl /Users/amw/Library/Application Support/Firefox/Profiles/fwq67dk5.default/extensions/zoteroquicklook@gmail.com/chrome/content/zoteroquicklook.pl /Users/amw/Documents/Zettelbank/Zotero/storage/9J2NI326/index.html
2010.07.08 17:06:16 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
2010.07.08 17:06:18 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
2010.07.08 17:06:18 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook opening viewer
2010.07.08 17:06:18 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook calling a shell command: /usr/bin/perl /Users/amw/Library/Application Support/Firefox/Profiles/fwq67dk5.default/extensions/zoteroquicklook@gmail.com/chrome/content/zoteroquicklook.pl /Users/amw/Documents/Zettelbank/Zotero/storage/9J2NI326/index.html
2010.07.08 17:06:19 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
2010.07.08 17:11:51 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
2010.07.08 17:11:51 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook opening viewer
2010.07.08 17:11:51 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook calling a shell command: /usr/bin/perl /Users/amw/Library
/Application Support/Firefox/Profiles/fwq67dk5.default/extensions/zoteroquicklook@gmail.com/chrome/content/zoteroquicklook.pl /Users/amw/Documents/Zettelbank/Zotero/storage/TU2QH37J/index.html
2010.07.08 17:11:56 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
Here the debug output when I change Zotero to use the default storage directory in FF's profile and the plugin produces the expected results:
2010.07.08 17:02:10 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook loading
2010.07.08 17:02:10 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook loaded
2010.07.08 17:02:11 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook starts init
2010.07.08 17:02:11 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook finished init
2010.07.08 17:02:15 [0x0-0x366366].org.mozilla.firefox zotero(3): Translate: Searching for translators for http://forums.zotero.org/discussion/11441/2/new-plugin-zoteroquicklook/#Item_30
2010.07.08 17:03:13 [0x0-0x366366].org.mozilla.firefox Zotero Forums - New plugin: ZoteroQuickLook
2010.07.08 17:03:13 [0x0-0x366366].org.mozilla.firefox http://forums.zotero.org/discussion/11441/2/new-plugin-zoteroquicklook/#Item_30
2010.07.08 17:03:19 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
2010.07.08 17:03:19 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook opening viewer
2010.07.08 17:03:19 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook calling a shell command: /usr/bin/perl /Users/amw/Library/Application Support/Firefox/Profiles/fwq67dk5.default/extensions/zoteroquicklook@gmail.com/chrome/content/zoteroquicklook.pl /Users/amw/Library/Application Support/Firefox/Profiles/fwq67dk5.default/zotero/storage/J4AGTP89/index.html
2010.07.08 17:03:37 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
2010.07.08 17:03:40 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
2010.07.08 17:03:40 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook opening viewer
2010.07.08 17:03:40 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook calling a shell command: /usr/bin/perl /Users/amw/Library/Application Support/Firefox/Profiles/fwq67dk5.default/extensions/zoteroquicklook@gmail.com/chrome/content/zoteroquicklook.pl /Users/amw/Library/Application Support/Firefox/Profiles/fwq67dk5.default/zotero/storage/J4AGTP89/index.html
2010.07.08 17:03:41 [0x0-0x366366].org.mozilla.firefox zotero(3): ZoteroQuickLook active. Dialog: false
Hope this is of some use (feel slightly out of my depth here...)
My short-term solution is clearly that I use FF's default storage because your plugin is so immensly useful to me. Thanks for this!
Can you confirm that the file
/Users/amw/Documents/Zettelbank/Zotero/storage/TU2QH37J/index.html
exists in your system?
I will add some debug output to the perl script to make it easier to debug this issue.
/Users/amw/Documents/Zettelbank/Zotero/storage/TU2QH37J/index.html
I'll stay tuned. Thanks. Let me know if I can be of help.
The problem on Linux is quite tricky: When you press space, the plugin creates a new process that opens the gloobus window. When you press space again, the plugin checks if the process exists and is alive. If so, the plugin kills the process. For some reason when the process is launched from the add citation dialog, checking the status will freeze the browser.
I disabled checking if the process is alive if the system is Linux and now the system works. Apparently gloobus takes focus when it activates and closes with space. (QuickLook on OS X does not take focus when it activates and thus the need to kill the process from the plugin.)
Anyway, it works now on my Linux. (And a new version is available for download.)
Test reports are more than welcome. I intend to publish this in the Mozilla Extensions Directory on Monday.
My last post was not clear. It does not work even with double backslash (\\).
I tried to understand what's going wrong on Win: I've tested the three different versions of ZQL that you've released since yesterday (all "0.2.0"). I'll call them 0.2.0a (the first one); 0.2.0b (the second one); 0.2.0c (today).
None of these versions work. But 0.2.0a is displaying a warning message ("C:Program FilesmaComfortmaComfort.exe is missing. etc)
----
The debug output (only the last lines: when I'm pressing spacebar) with:
-0.2.0a
zotero(3): ZoteroQuickLook active. Dialog: false
zotero(3): ZoteroQuickLook opening viewer
-0.2.0b
zotero(3): ZoteroQuickLook active. Dialog: false
-0.2.0c
Nothing in the debug output!
-----
These tests gave the same result (in the debug output) when I set zoteroquicklook.customviewcommand to C:\Program Files\maComfort\maComfort.exe
Hope that can help. Thank you for everything.
[Win 7-32bits; FF 3.6.6]
----
EDIT: With ZQL 0.1.5 (and these changes), it works perfectly and the debug output is:
zotero(3): ZoteroQuickLook active
zotero(3): ZoteroQuickLook opening viewer
zotero(3): ZoteroQuickLook active
If you get nothing from the latest version, you should reinstall the plugin. There were some errors that I fixed, but since this thread was quiet, I did not announce them.
After this current feature set is done and works on all three platforms, I will add a feature for browsing PDFs with quicklook on using the arrow keys.
It's now working well... if I set zoteroquicklook.filenameworkaround to false (french accent in filename)
One minor problem: if I press spacebar to close the ZQL, it closes then immediately reopens (except with pdf!!!?)
Thank you very much. That's great!