This script is similar to the one used to change the font size, but the first line points to a different menu item. bring the target application to the frontīecause I often bulk edit metadata in Zotero to ensure consistency, I like to have quick access to the JavaScript window that makes this possible. On do_submenu(app_name, menu_name, menu_item, submenu_item) The full AppleScript with the handler and the execution of the handler is here:ĭo_submenu("Zotero", "View", "Font Size", "Bigger") Handlers allow you to reuse code snippets easily. Using a handler from MacScripter, I used the following arguments with the do_submenu handler to increase the Zotero font size:ĭo_submenu("Zotero", "View", "Font Size", "Bigger"). Several menu items in Zotero don't have a keyboard shortcut where one would be helpful. However, using the keyboard system preferences does not require a third-party utility. I use the scripting approach to manage all the keyboard shortcuts in one place (rather than having shortcuts in system preferences and shortcuts in FastScripts). Note that these scripts that select menu items could also be done with the macOS built-in keyboard shortcut feature in the keyboard system preferences. Selecting menu items via keyboard shortcuts The F16 key can either be pressed again to perform the same operation on the next author or ignored if all author first and last names have been populated correctly. The keystroke tab line in the above script automatically moves the cursor to the next author, so this does not need to be done manually. To trigger this script, I used an unused function key, F16, which was convenient to type multiple times if there were numerous author names to swap. Saving this script in the ~/Library/Scripts/Applications/Zoterofolder will make the script available in FastScripts when Zotero is the front application. This script simulates keystrokes to highlight the first name, cut the first name, tab from the lastname field to the firstname field, and paste the first name into the firstname field. use AppleScript version "2.4" - Yosemite (10.10) or later Assuming this is true, and the cursor is placed at the beginning of the lastname field, the script will move the first name to the correct field and leave the last name as is. GUI scripting involves manually simulating keystrokes that mimic selecting words, copying text, tabbing to a new field, and pasting the text.įor the script below to work, both the author's first name and last name must be in the lastname field and in the first name last name order. Using GUI scripting, I used AppleScript to move the first name to the correct field and leave the last name where it was, rather than manually doing a copy and paste for each author. In my case, the authors’ names were in firstname lastname format in the lastname field. When I imported my ReadCube Papers library into Zotero, the author’s first name and last name did not map correctly for several citations. Swap first name and last name in the authors’ field If you prefer to script your automation directly, this post is for you. Using Keyboard Maestro, built-in tools such as keystroke and menu selection will be an easier way to accomplish what is done in the scripts below. As with the article on ReadCube Papers, these scripts will need to be executed with a third-party utility such as FastScripts or Keyboard Maestro, as I described in my previous post.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |