Create Beautiful PDFs From Your Tinderbox Documents

Below is a short vanilla AppleScript that takes the names and text from selected notes in Tinderbox and creates slides in Keynote. From Keynote File > Print > Grid and choosing PDF gives this:

Test Tinderbox to Keynote grid printout

  1. Copy-paste script into Script Editor (in Applications > Utilities).
  2. Have this Keynote document open: Test Tinderbox to Keynote document (Dropbox Download).
  3. Select notes in Tinderbox and run script via the run button in Script Editor.

Output (layout, fonts, placement) is easily changed by editing the custom ‘Title & Text’ slide layout. Editing a slide layout is explained here: Add and edit slide layouts in Keynote on Mac

The script:

-- gathers name and text of selected Tinderbox notes
tell front document of application "Tinderbox 9"
	set noteNames to {}
	set noteTexts to {}
	repeat with aNote in (get selections)
		set end of noteNames to name of aNote
		set end of noteTexts to text of aNote
	end repeat
end tell

tell application "Keynote"
	tell front document
		repeat with i from 1 to length of noteNames
			-- "Title & Text" is custom slide layout - can edit in Keynote
			my createSlide("Title & Text", item i of noteNames, item i of noteTexts)
		end repeat
		delete slide 1 -- to prevent title slide from being printed
	end tell
end tell

on createSlide(masterSlideName, thisSlideTitle, thisSlideBody)
	tell front document of application "Keynote"
		set thisSlide to make new slide with properties {base layout:slide layout masterSlideName}
		tell thisSlide
			set the object text of the default title item to thisSlideTitle
			set the object text of the default body item to thisSlideBody
		end tell
	end tell
end createSlide
5 Likes

I (re)learned that Tinderbox AppleScript support is unusually strong in certain areas. The first “tell block” in the script above can be more concise:

tell front document of application "Tinderbox 9"
	tell selections
		set noteNames to name
		set noteTexts to value of attribute "Text"
	end tell
end tell

That’s shorter. And it’s faster (though probably not noticably so). It is roughly equivalent to the values operator in Tinderbox action code.

2 Likes