November 13, 2009

Accordance Bibliographic Citations in Pages

I am making publicly available my "Accordance to Pages Citation Paster" script.

You can download the latest version from The Macintosh Biblioblog's Downloads section.
Here is more information from the ReadMe file.

Accordance to Pages Citation Paster

version 0.7

The Accordance to Pages Citation Paster is created to work with the bibliographical citation function within Accordance Bible Software in Accordance 8.4 and up. Using that function, you can paste in copied text as well as a footnote in word processors such as Microsoft Word. However, a shortcoming of iWorks Pages does not permit footnotes to be pasted into a document. This script is a workaround for that shortcoming. In addition, the script can by default also include the task of Copy as Citation in Accordance before bringing Pages to the front and pasting in the citation, so you can do it all in one command.

The Accordance to Pages Citation Paster script:

-- Can optionally Copy as Citation from Accordance first if it is the frontmost app.

-- Can optionally insert an empty footnote if none detected in the citation.

To install: Leave 'Put bibliography details as footnote' UNchecked in Accordance preferences in order to copy a citation format this script can use.

It can be launched from the typical script locations. For information about launching the script in the system wide Script Menu run the Applescript Editor and check the help files.

If you want to assign a keyboard shortcut to run the script, you'll have to use a tool like

Quicksilver ( http://www.blacktree.com/ )

or FastScripts ( http://www.red-sweater.com/fastscripts/ ). For a simple, system-wide key combo trigger I'd recommend FastScripts. The script can also be launched from utilities like Butler, LaunchBar, Automator, or even Services. (Do your own research on how to do so, please.)

If you open the script in the Finder, it will not run, it will open it up in Applescript Editor. There are a couple options you can tweak inside the editor. The beginning of the script includes this:

You can change copyCitationFromAccordance from true to false to prevent the script from doing the Copy as Citation within Accordance.

You can change insertEmptyFootnote from false to true to have the script insert an empty Footnote when pasting a citation that does not include one.

You can also change the script's speed to ensure stability or try and speed it up (by setting the n property to 0

Note: You didn't pay for this, so you get no implied warranties or guarantees for it. (If you do send me a donation, then you can demand any guarantee you like.)

Note: The author is not associated with OakTree software and the Accordance folks are not responsible for the support, use or content of this script.

Written by Joe Weaks, November 13, 2009

Available at The Macintosh Biblioblog

6 comments:

Ute & Christian said...

Would be nice if I could chose a different font & font size. In my documents I use Helvetica 12 and 10 in Footnotes ...

Joe Weaks said...

Wouldn't be hard to add that into the script. The script is VERY well commented. Open it up in AppleScript Editor and then google for solutions on code to add for setting font of a selection.

Joe Weaks said...

Here's a discussion about a couple ways to change the default font in Pages

Unknown said...

I really am glad that you have posted this for all to use. I immediately tried to hack together a service for it in automator. Then there was a problem. If I accidentally selected an extra line break at the end of the selection, the footnote marker would be placed on a new line under the pasted text.

I really do not know applescript well at all. The whole human language feel of it throws me off. Regardless, I ended up breaking the script into two pieces. The first automator action handles the Accordance work (I also added tell application "Accordance" activate end tell). I then added some code to remove the extra line break if it existed and return the result. I then had a step in automator that copied the returned text into the clipboard. Then I added a second "Run Applescript" event with the code for calling pages and doing the work therein. I had to resort to this method because when I tried to do something like "set the clipboard to myVar" the clipboard contents remained unmodified.

end adding two cents

Joe Weaks said...

revision,

Good for you for doing your own customizations.
set the clipboard to myVar
and
set myVar to the clipboard
are valid syntax so not sure why you're erroring. However, I have omitted manipulations of the citation, because I'm keeping the text all on the clipboard in order to preserve the rich text formatting. Once you save it to a variable in Applescript, it loses the rich text formatting (bold, italics, etc.) that is important in bib citations.
That said, it'd be easy to add a handler that checked the contents of the clipboard and removed empty paragraphs and spaces from the end of the selection within Pages. I'll put that in the next version.

Joe Weaks said...

I've added it to the newly posted version 0.9

I have continue to use no handlers in order to make it easier for folks to follow the comments and the flow of the script, for doing things like pasting it into automator.