Macros

I find I tend to do the same actions with many/most items I add to Zotero. So, I was wondering if it would be possible to add a macro/macro-key feature.

I.e., a way to enter and save, say, javascript and bind it to a key in Zotero.
  • It is difficult to understand what you want to have. You need to explain your request in more detail (e.g. with an example) and then explain where the current implementation fails short.
  • Hi mronkko ... sorry I wasn't clearer. I don't think the current implementation falls short per se.

    I have a habit in programs such as Word or Excel, of using macros to do little housekeeping chores (things I find I do a lot).

    In Zotero, I find that on most new items I:
    1) fix up the case of the title
    2) rename the pdf
    3) remove the URL if it is a link to the DOI, and so on

    From time to time, I also find I want to update several items in a similar way; for example, I might want to change all instances of an author from "Hinnings, C. R." to "Hinnings, C. Robert".

    There are lot's of little things like this.

    I got to thinking, that these are somewhat idiosyncratic (they apply to me and maybe just to me). So, rather than ask for a series of changes, I thought if there was a 'macro' like interface (and I suggested javascript because I thought it would be easiest to implement), then I could make 'macros' to do these things.

    One of the things that make macros easy to use (I've found) is binding them to keys, so that when I press, say, Ctrl-z it could trigger my 'TidyUpItem' macro.

    So, what would be nice is a way to store scripts/macros in Zotero and execute them by binding individual scripts to specific keys.

    I hope that's clearer.
  • that's a long way out. First we need batch editing.
    PDFs are automatically renamed already, though - check the filename in the right-hand pane (rather than the file _label_ in the center pane).
  • For me, macros would reduce the need for batch editing (or search/replace) and would be more versatile.
  • You can already run arbitrary privileged JS via other Firefox extensions. There's no particular reason for Zotero to provide it (except for Standalone, but other extensions can be made to work in Standalone).

    For what it's worth, none of the things you request (except maybe #3) are uncommon requests, which is why solving those for all users is much more important:
    1) fix up the case of the title
    Right-click on the title, Transform Text
    2) rename the pdf
    Right-click on the attachment, Rename File from Parent Metadata (which is done automatically for attachments saved via translators). The format string can be configured, but the format options are limited right now. See other threads for more details.
    From time to time, I also find I want to update several items in a similar way
    Batch editing is planned.
  • For me, macros would reduce the need for batch editing (or search/replace) and would be more versatile.
    Yes, but you're in the small minority of users who would ever use macros (and, really, unless you're going to take the time to figure out the JS yourself, you're probably not going to use them much either, since it's unlikely developers are going to take the time to provide JS snippets that benefit just a few people).

    But if you're comfortable writing the JS yourself, get one of the existing Firefox extensions that can do this. (I don't know if it still works, but keyconfig was one.)
  • Hello Dan,

    Thanks. Yes, I do many/all of those things already. And I do run JS via an add-on. But there are tweaks ... the transform text doesn't get it quite APA 'ready'.

    It was a convenience thing more than anything else--having the macro stored and easily accessible.

    Nevertheless, I can appreciate that few users would use it (as with macros in Word/Excel).
  • You can already define custom scripts with another extension:

    https://addons.mozilla.org/en-US/firefox/addon/custom-buttons/

    Do you think that Zotero should duplicate this functionality, or did I miss something?
  • My work is spread across several different platforms, so I pretty much only use standalone Zotero nowadays.
  • You should take a look at that plugin and use the Firefox plugin instead of the Standalone (Standalone can use plugins, but it does not have a toolbar where you could pin the custom buttons to).. You can still use connectors for other browsers and just use Firefox as a container for Zotero.

    Would this solve your problem?
Sign In or Register to comment.