shortcuts in Libreoffice plugin
First off, congratulations to the developers for the new version. It brings a number of improvements to my work.
One thing I can't figure out is how I can set keyboard shortcuts in libreoffice, for instance, to add or edit citations. My old shortcuts don't work anymore. In the LO-shortcut-menu I used to find the Zotero-functions in the macros-section, but they seem to have disappeared from there and I can't find it anywhere else. Can anyone point me in the right direction?
One thing I can't figure out is how I can set keyboard shortcuts in libreoffice, for instance, to add or edit citations. My old shortcuts don't work anymore. In the LO-shortcut-menu I used to find the Zotero-functions in the macros-section, but they seem to have disappeared from there and I can't find it anywhere else. Can anyone point me in the right direction?
createUnoService("org.zotero.integration.ooo.ZoteroOpenOfficeIntegration").trigger("addCitation")
(where "addCitation" can also be "editCitation", "addBibliography", "editBibliography", "refresh", "setDocPrefs", or "removeCodes"). I'll investigate assigning shortcuts to the toolbar functions by default.
edit: I figured it out. Thanks again.
Can you enlighten me? My coding experience with OpenOffice is minimal. Where do I paste the createUnoService? What should be before and after the createUnoService line of code?
Can anybody help?
Thanks!
* go to Extras (Tools??) > Macros > Manage Macros > Libreoffice Basic
* single-click "Standard" in the left pane, then choose "Manage", then choose "New" in the newly opened window. Type in a name for the makro, e.g. InsertCitation
* you should be back at the Manage Macros Window then. Have the newly created Macro highlighted and click "Change"
* an editor should pop up with the following three lines:
REM ***** BASIC *****
Sub Main
End Sub
* paste Simon's command line between the last two lines. It's cut-off in the above post and should end with "...addCitation")"
REM ***** BASIC *****
Sub Main
createUnoService("org.zotero.integration.ooo.ZoteroOpenOfficeIntegration").trigger("addCitation")
End Sub
* click the save-icon and close the window.
* you can now assign short-cuts to the created macro
I'm not sure if there are better or more elegant ways for this. I just played around without knowing what I'm doing and this did the trick for me.
It works now (Mac 10.6.7 - Libreoffice 3.3.1 - Firefox 4 - Zotero 2.1.6 - Zotero OpenOffice Integration 3.5a1)...
something to add to your instructions ... after changing the code ...
I had to
* click the compile-icon
* click the save-icon (was greyed out without clicking the compile-icon)
Are you using a non-English version of LO? It's possible that one of the folders would be named differently.
http://www.zotero.org/support/word_processor_plugin_shortcuts
adding other word processors would be very welcome.
Using LibreOffice 5.3.3.2 on Windows 7x64 with Zotero 4.0.29.21 in Firefox 52 and Zotero LibreOffice Plugins 3,5,12...
The LibreOffice macros that some of the prior answers say to create now exist already. See Menu -> Tools -> Macros -> Edit Macros, then expand My Macros -> Standard -> Zotero -> Zotero and you'll see macros for all of the functions that are available on the toolbar buttons.
To assign them to keys, use Menu -> Tools -> Customise, click 'Keyboard' tab. Click in the top 'Shortcut Keys' frame, then press the key combination you wish to assign. Then in the bottom left half 'Functions, Category' of that dialogue, expand LibreOffice Macros -> user -> Zotero -> Zotero, select the macro you wish to assign from the middle 'Function' box, and with the key combination highlighted in the top window and the macro of choice highlighted in the middle/lower window, click the 'Modify' button at top-right in the dialogue box.
Just like that, the key combo is assigned.
To apply more, wash, rinse, repeat.
I hope this helps someone! :-)
Best,
G