Invoking Bookends AppleScript via Service Keyboard Shortcut
Posted: Wed Mar 30, 2022 3:32 pm
Hey folks,
I've written a short and sweet AppleScript to switch from my word processor (Mellel) to Bookends and invoke "Copy Citation and Modifiers." I've pasted it in below. When I run the script from Script Editor or directly within Automator by clicking the "run" button within the "Run AppleScript" command dialog box in Automator, it works fine. I've saved the Automator script as a Quick Action to run within Mellel, and I've defined a keyboard shortcut to invoke the Quick Action.
However, when I use the keyboard shortcut, my workspace shifts to Bookends (so it follows the "activate Bookends" command), but then stops.
Does anyone have any idea why this would happen? I realize this may not be a Bookends-specific question. This might have something more global to do with Quick Actions, the "Run AppleScript" command in Automator, and keyboard shortcuts, but I thought I'd start here.
Thanks,
Bill Blattner
---------
The script:
on run {input, parameters}
activate application "Bookends"
tell application "System Events"
tell process "Bookends"
click menu item "Copy Citation and Modifiers…" of menu 1 of menu bar item "Edit" of menu bar 1
end tell
end tell
return input
end run
I've written a short and sweet AppleScript to switch from my word processor (Mellel) to Bookends and invoke "Copy Citation and Modifiers." I've pasted it in below. When I run the script from Script Editor or directly within Automator by clicking the "run" button within the "Run AppleScript" command dialog box in Automator, it works fine. I've saved the Automator script as a Quick Action to run within Mellel, and I've defined a keyboard shortcut to invoke the Quick Action.
However, when I use the keyboard shortcut, my workspace shifts to Bookends (so it follows the "activate Bookends" command), but then stops.
Does anyone have any idea why this would happen? I realize this may not be a Bookends-specific question. This might have something more global to do with Quick Actions, the "Run AppleScript" command in Automator, and keyboard shortcuts, but I thought I'd start here.
Thanks,
Bill Blattner
---------
The script:
on run {input, parameters}
activate application "Bookends"
tell application "System Events"
tell process "Bookends"
click menu item "Copy Citation and Modifiers…" of menu 1 of menu bar item "Edit" of menu bar 1
end tell
end tell
return input
end run