Jumping from Word to Bookends

A place for users to ask each other questions, make suggestions, and discuss Bookends.
Post Reply
vinschger
Posts: 57
Joined: Fri Nov 19, 2021 1:28 pm

Jumping from Word to Bookends

Post by vinschger »

If I select a text in a Word document (e.g. a PMID or DOI), I have the possibility to go to the Words-Smartbar Bookends Menu and select "Find in Bookends", then a search window appears, I confirm and then the according reference is shown in Bookends. Is there a possibility to speed this up?

Ideally I would like to select the text in Word, press a shortcut, and then the reference (or if there is an associated pdf maybe even the pdf itself) is shown directly? Maybe this is already possible and I do not know how to do this... or is this anything that could be achieved with scripting or macos shortcut configuration?

If it's not possible, the current workflow is absolutely okay, but if there is a faster way to achieve this, any help would be appreciated.
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Jumping from Word to Bookends

Post by Jon »

The Find dialog gives you the opportunity to specify what kind of search you want. If it's for a unique identifier then of course it's unnecessary. But in other cases you might want it to search just titles, authors, etc. If it's already set to what you want then press Return and the search is executed, it's not a big deal. As for invoking it with a keyboard shortcut, you'd have to do that in Word, it's not up to Bookends.

Jon
Sonny Software
vinschger
Posts: 57
Joined: Fri Nov 19, 2021 1:28 pm

Re: Jumping from Word to Bookends

Post by vinschger »

Thanks. Indeed, it's not a big thing. Regarding the Word shortcut: do you know, if/how it's possible to access the "find in bookends" feature with a shortcut in Word? As it's not in the menu bit in the menu-bar I am not sure, how this can be done. Do you Jon, or anyone else, have an idea how to set this up? Thanks in advance:
Jon
Site Admin
Posts: 10048
Joined: Tue Jul 13, 2004 6:27 pm
Location: Bethesda, MD
Contact:

Re: Jumping from Word to Bookends

Post by Jon »

I don't know, you'll have to google for that.

Jon
Sonny Software
iandol
Posts: 465
Joined: Fri Jan 25, 2008 2:31 pm

Re: Jumping from Word to Bookends

Post by iandol »

My Bookends Tools for Alfred includes a couple of actions that almost do what you want. For example I have an action that can take a selected Bookends unique id from a temp ref and search for it in Bookends with one key binding, using this fairly simple applescript underneath which copies selection to clipboard and uses the bookends:// uri feature to activate a reference.

Code: Select all

#!/usr/bin/osascript
tell application "System Events"
	keystroke "c" using command down
	delay 0.3
	do shell script "id=$(pbpaste); open \"bookends://sonnysoftware.com/$id\""
end tell
Applescript can be used to initiate a search. You don't need Alfred to trigger applescript, and while I personally think it is the most flexible and cool automation interface available, other tools can do the same thing...

What exactly do you want: to select either PMID or DOI, or both and what do you want to do, generic search to activate the linked ref?
vinschger
Posts: 57
Joined: Fri Nov 19, 2021 1:28 pm

Re: Jumping from Word to Bookends

Post by vinschger »

thank you, iandol! bookends unique ID would be absolutely fine! I would like to select the unique ID in my word manuscript, press a shortcut, and then the according pdf in bookends should open directly - and if there is no associated pdf, the item should be shown in bookends (so that I can read the abstract and the notes/notecards etc). that would be simply great. Is this already possible with your alfred scripts? or even better, would this be possible with an applescript (so that I do not have to additionally install Alfred)?
iandol
Posts: 465
Joined: Fri Jan 25, 2008 2:31 pm

Re: Jumping from Word to Bookends

Post by iandol »

I didn't really test this, and I'm sure someone who is better at Applescript can improve this, but this will take selected text (a uniqueID) in any app, copy it to the clipboard, then try to find the uniqueID ref, try to open the first attachment and if no attachment, open the ref in bookends:

Code: Select all

#!/usr/bin/osascript

tell application "System Events"
	keystroke "c" using command down
	delay 0.3
end tell

tell application "Bookends"
	tell front library window
		--set myID to "750"
		set myID to the clipboard
		try
			set pub to sql search "uniqueID = " & myID
			set myPub to first item of pub
		on error
			display dialog "Couldn't find reference: " & myID
			return
		end try
		try
			set myAtt to first item of attachment items of myPub
			set myPath to path of myAtt
			tell application "Finder" to open myPath as POSIX file
		on error
			do shell script "open \"bookends://sonnysoftware.com/" & myID & "\""
		end try
	end tell
end tell
vinschger
Posts: 57
Joined: Fri Nov 19, 2021 1:28 pm

Re: Jumping from Word to Bookends

Post by vinschger »

wow thanks. I will test it... thanks so much...
do you think about adding it also to your Alfred tools?
iandol
Posts: 465
Joined: Fri Jan 25, 2008 2:31 pm

Re: Jumping from Word to Bookends

Post by iandol »

I am very short on time, but yes I will probably add it there eventually, possibly to the existing tool and add a config option so you can choose to prefer PDF or prefer reference...
Post Reply