Created
May 31, 2012 18:43
-
-
Save i-blis/2845332 to your computer and use it in GitHub Desktop.
Export notes from Keynote to OmniOutliner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env macruby | |
framework 'scriptingbridge' | |
keynote = SBApplication.applicationWithBundleIdentifier("com.apple.iWork.Keynote") | |
outliner = SBApplication.applicationWithBundleIdentifier("com.omnigroup.OmniOutlinerPro3") | |
document = outliner.classForScriptingClass('document').new | |
outliner.documents << document | |
document.get.statusVisible = false | |
document.get.columnTitleStyle.attributes[29].value = 'center' | |
column = outliner.classForScriptingClass('column').new | |
document.columns << column | |
column.get.title = '#' | |
column.get.alignment = 1330929969 # misses constant name for center alignment | |
column.get.index = 2 | |
slideshow = keynote.slideshows.first | |
slideshow.slides.each do |slide| | |
document.rows << outliner.classForScriptingClass('row').new | |
#document.rows.last.cells << outliner.classForScriptingClass('cell').new | |
cells = document.rows.last.cells | |
cells.select { |e| e.column.index == 3 }.first.value = slide.notes | |
cells.select { |e| e.column.index == 2 }.first.value = slide.slideNumber.to_s | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment