Page 1 of 1

Set focus on specific group or reference

Posted: Tue Dec 17, 2019 9:03 am
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!

Re: Set focus on specific group or reference

Posted: Tue Dec 17, 2019 9:58 am
by Jon
It's not built in, but it might conceivably be might be done with GUI scripting.

Jon
Sonny Software

Re: Set focus on specific group or reference

Posted: Wed Dec 18, 2019 3:00 am
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.

Re: Set focus on specific group or reference

Posted: Wed Dec 18, 2019 10:03 am
by Jon
Perhaps someone who know more than I do about scripting can help.

Jon
Sonny Software

Re: Set focus on specific group or reference

Posted: Mon Apr 27, 2020 8:59 pm
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.