Set focus on specific group or reference

Users asking other users for AppleScripts that work with Bookends.
Post Reply
lucius
Posts: 4
Joined: Tue Dec 03, 2019 11:19 am

Set focus on specific group or reference

Post by lucius »

Is it possible to set the focus (using AppleScript) on a specific group or references of the front window?
I know how to get selected references (using "set ePubList to (selected publication items"), but I want to the opposite.
The reason is that once I select a given reference I want to trigger the "Autofill from Internet" --> "All fields (shit+Command+A) using:

Code: Select all

tell application "System Events"
	tell application "Bookends" to activate
	delay 0.5
	key code 125
	delay 0.5
	keystroke "A" using {command down, shift down}
	delay 2
end tell

Thanks!

Jon
Site Admin
Posts: 8788
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Set focus on specific group or reference

Post by Jon »

It's not built in, but it might conceivably be might be done with GUI scripting.

Jon
Sonny Software

lucius
Posts: 4
Joined: Tue Dec 03, 2019 11:19 am

Re: Set focus on specific group or reference

Post by lucius »

Thanks Jon.
I looked into the possibility of using GUI scripting, but I couldn't find any "link" to specific group neither in the menubar menus nor by using "UI Browser" (https://pfiddlesoft.com/uibrowser).
It seems to me that "groups" are a kind of "ghost" in Bookends.
Any help would be very appreciated.
Thanks!
L.

Jon
Site Admin
Posts: 8788
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Set focus on specific group or reference

Post by Jon »

Perhaps someone who know more than I do about scripting can help.

Jon
Sonny Software

DerangedChef
Posts: 19
Joined: Mon Aug 13, 2018 3:56 am

Re: Set focus on specific group or reference

Post by DerangedChef »

@lucius

As a suggestion, you could use "Keyboard Maestro" for such macro tasks in the GUI of any app.
I.e., record a macro that would click on the group that you need, or use Bookends' "Find a group" popup command and insert the group's name to search for it, all in KM's macro actions. KM also has actions that can execute menu commands in BE.

AppleScript can be included if you need to do more sophisticated things.

This is a bit of a "brute force" way of doing repeated tasks, and you watch the macro doing its steps, but it might save time nonetheless.
--
Stefan L. :roll:

Post Reply