Page 1 of 1

Automate Folder Export

Posted: Fri Jan 08, 2016 8:15 pm
by Nhaps
I use BE with Scrivener, and the Copy Citation works quickly between the two, I like it. But I am looking for a way to have BE automate my .bib file for LaTeX, but the question appeals to anyone that needs to export a folder of refs. So far it takes many clicks for me to do the following:

1. Drag reference used with Copy Citation to a folder
2. Export references within that folder to a bib file

How can I have BE automatically export a folder upon citing or having edited a reference? For those of us who use LaTeX this would come handy! Could there be a watch folder for references in addition to attachments?

Re: Automate Folder Export

Posted: Mon Jan 11, 2016 9:37 am
by Jon
You still have to move those refs to a group, right (not a folder)? When you're ready to export, select the group, make all items in the groups hits (the shortcut I use is to click on the checkbox of one with the Shift key held down -- now all are hits, then Shift-Command-B to export.

Jon
Sonny Software

Re: Automate Folder Export

Posted: Mon Jan 11, 2016 6:45 pm
by Nhaps
These two shortcuts help, thanks. It could be a group too, not necessarily a folder. But we could improve BE with these options:

1. Every time Copy Citation is invoked, given ref is copied to group or folder
2. Every time shift-command-B is invoked, all refs are automatically marked
3. Every X minutes group folder exports its content

Meanwhile I was able to study how Applescript works, so this script is provisional. Shortcuts are no longer necessary. Folder to be exported needs to be selected first. Then script will select references, and export to a bib file.

Code: Select all

tell application "Bookends"
	activate
end tell

tell application "System Events"
	tell process "Bookends"
		keystroke "h" using {option down, shift down, command down}
		delay 0.5
		click menu item "Mark All References" of menu 1 of menu item "Mark" of menu 1 of menu bar item "Refs" of menu bar 1
	end tell
end tell

tell application "System Events"
	tell process "Bookends"
		keystroke "b" using {shift down, command down}
		keystroke return
		delay 0.5
		keystroke return
		delay 0.5
		keystroke "r" using {command down}
	end tell
end tell