Link to a Zotero item from its reference in word processor (word/oo plugin feature request)
I wish there was an easier way to pull up my notes on a book/article when writing. Often, when thinking about a particular book/essay, I have a thought that I would like to add to the note attached to the Zotero Item, or I want to read my existing notes on the book.
However, it is very cumbersome to jump from an existing reference in a text document to a Zotero item. You basically have to task-switch to Firefox, open Zotero, run a search, then pick the right entry from the results.
It would be nice if there was a way from jumping from a reference in a Word document right to the Zotero item (quick access to notes and related items!). Here's what I have in mind: put the curson on a Zotero citation in your text document, then hit either a button, context menu or keyboard shortcut to bring up Zotero with the corresponding Zotero Item selected.
Now THAT would be a real timesaver for lots of people IMHO.
However, it is very cumbersome to jump from an existing reference in a text document to a Zotero item. You basically have to task-switch to Firefox, open Zotero, run a search, then pick the right entry from the results.
It would be nice if there was a way from jumping from a reference in a Word document right to the Zotero item (quick access to notes and related items!). Here's what I have in mind: put the curson on a Zotero citation in your text document, then hit either a button, context menu or keyboard shortcut to bring up Zotero with the corresponding Zotero Item selected.
Now THAT would be a real timesaver for lots of people IMHO.
Currently you can somewhat do this by using ZoteroQuickLook (https://addons.mozilla.org/en-US/firefox/addon/111142/)
1) Edit the citation
2) In the edit dialog, highlight the item you want to view
3) Press space bar to view the PDF
Takes a second or two. The downside is that you cannot edit the PDF or the Zotero item this way.
The fact that you can't even read them is really unfortunate.
Note for those interested in the plugin: it only works for attached, but not for linked PDF files.
is there a roadmap for this feature?
Especially if you are working within a group this is a basic necessity - if a new reference is added there is no direct way for the others to have a look on the entry???
Also, even working alone: When citing a reference in a text I quite often have the need to change/add a keyword, a note...
that´s bad.
That is a knockout criterium.
We are planning to work on guidelines, there is a need for discussion and the citations need to be evaluated, so an easy access to the entries (and to the original, but editable text) is badly needed.
I don't really have a comment on whether we'd add a button for this, but it's worth discussing.
Really the only question here is if it's worth space in the word processor.
http://gregmaxey.mvps.org/Customize_Word2007_SC_Menu_Programatically.htm
How about make r-click in the Add/Edit Citation dialog (currently does nothing) to open the main zotero window with that same reference selected. - or even better make the r-click in the edit Add/Edit Citation dialog bring up a small context menu with options such as "view, info, notes, tags, related" that opens the respective view in zotero.
This might be easier to implement as the context menu is in the zotero code (as opposed to making the rclick context menu inside Word.)
http://forums.zotero.org/discussion/11441/4/new-plugin-zoteroquicklook/
It seems like it would be so straight forward to add a further word add-in to which a shortcut key could be assigned that I even wanted to give it a bash myself. Only problem is that the existing Zotero add-in macros I wanted to build off (I can do basic macros, but I'm no programmer) are not viewable. That seems a shame for an otherwise FANTASTIC open source project and has stopped me potentially developing something I would happily have shared with everyone.
Also, of course the word plugin is open source, it's even on github:
http://www.zotero.org/support/dev/svn_and_trac_access (bottom of the screen).
To get this working on windows, you would only need to write a template file that includes the definition for a new button and corresponding keyboard shortcut. Pressing this button would need to send a message to Zotero. The content would be the same as for editing citations, but instead of editCitation, it would start with quickLook.
If you can provide this template file, I can write an installer for it and bundle it with ZoteroQuickLook so that it will be available for all Windows users in the next release.
Mronkko, well done with QuickLook, but it doesn't meet my needs as I need to not just to see, but to edit the Zotero citation data, notes and associated pdfs. Simon, you're right about the macros not helping me and unfortunately coding a firefox extension is well beyond my modest capabilities.
In the interest of trying to help out such a great project, however, I did manage to create a very inelegant workaround using a word macro which I might as well share because, to my surprise, it works. I had very little idea what I was doing (am a lawyer, not a programmer), but managed to produce something that seems to work by building off Zotero's 8 character identifiers and how the Gnotero extension seemed to work.
You need to create a new module in Word to use ShellExecute to open the identifier extracted from the relevant Word footnote's field code in a blank new tab in firefox which also selects the relevant item in Zotero in the AppTab. It's a bit clumsy, because you need to click Ctrl+Alt+Z once in firefox at the end.
I have never made a macro for other people before and am sure it is very ugly for all your programming types, but will try to post it in my next comment and then you can go to town on it! It will undoubtedly have problems, but currently works for me (on Windows 7, with Zotero 3 for Firefox always open as an AppTab in Firefox 7). Coming next post, hope it helps some people / gets the ball rolling.
You need to:
1. insert a new module in Word (go into the 'Tools | Macros' menu and select the 'Visual Basic Editor' menu item (or click Alt+F11). This should open up the VBA editor.
2. Create a new module by right clicking on the Modules folder, and selecting "Insert...| Module". The right hand side of the VBA editor should open up with an empty text editor.
3. Paste this text:
Const SW_SHOW = 1
Const SW_SHOWMINIMIZED = 2
Const SW_SHOWMAXIMIZED = 3
Public Declare Function ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub ZotNoteIDtoFFox()
Dim ZotID As String
Selection.Fields.ToggleShowCodes
Selection.Find.ClearFormatting
With Selection.Find
.Text = "/items/"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCharacter, Count:=1
Selection.MoveRight Unit:=wdCharacter, Count:=8, Extend:=wdExtend
ZotID = Selection.Text
Selection.Fields.ToggleShowCodes
Dim URLPath As String
URLPath = "zotero://select/items/0_" & ZotID
' The next line is the one to delete the message box once you've got the hang of it
MsgBox "- Locating Zotero item via: " & URLPath & "(will open useless new tab)" & vbNewLine & "- Once in Firefox, use Ctrl+Alt+Z to see the selected item in Zotero for Firefox" & vbNewLine & vbNewLine & "(This unnecessary message box should be deleted in the macro once you've got the hang of it)"
Dim RetVal As Long
On Error Resume Next
RetVal = ShellExecute(0, "open", "C:\Program Files (x86)\Mozilla Firefox\firefox.exe", URLPath, _
"<run in folder>", SW_SHOWMAXIMIZED)
End Sub
I hope this is ok. I'd feel embarrassed putting my terrible work on a permanent work on a permanent, programmer's utility. ;-)
I can only think of three ways around the problem:
(1) We could very easily develop separate macros to get the first, second, third etc sources (probably using something unique per citation in the field code like "uris"), but that wouldn't really be satisfactory, because you'd have to work out yourself what number source in the footnote it is.
(2) A looped macro could presumably open all of the sources of a footnote in separate instances of zotero, but mutliple instances would probably (hopefully) not be possible in Zotero for firefox.
(3) What I would like is a system whereby you could click on or select the text of the second item in the footnote and, running the macro from there, get the second source in Zotero. Presumably you could search previous for the separator (usually ";") from the cursor in the un-expanded footnote and use the number of hits to work out whether the item is the 1st, 2nd, 3rd etc in the footnote, then use the technique described at (1) above to go to that footnote in Zotero, but that's again just a theoretical approach not backed up by any real understanding of VBA.
Given that (1) and (2) aren't that helpful and that (3) involves all sorts of functions I don't really understand and would therefore take me a lot of time I don't have in the next little while (my wife will kill me if I srart trying to program this coming weekend away), I think it's better if I leave my contribution with this first-source-only limitation for the time being. My apologies. Hopefully some better programmers than I will be able to tidy it up and build upon it one day so that it overcomes this (and probably other) limitations.