How can I export an OmniOutliner document without using a mouse? I have to generate a PDF of an OmniOutliner document several times a day. Ultimately, I’m trying to automate the process using Keyboard Maestro.
Any ideas? Automator?
It would be great if OmniOutliner could simply export to PDF.
tell application "OmniOutliner"
activate
set winName to front document's name
tell application "System Events"
tell process "OmniOutliner"
keystroke "p" using command down
click window winName's sheet 1's menu button "PDF"
keystroke "p" using command down
keystroke return
end tell
end tell
end tell
You could attach that to a keyboard shortcut using KM (which I don’t use)
Or you can create an Automator Service in Automator and attach that to a keyboard shortcut. Fire up Automator, choose ‘Service’ as the document type, drag a ‘Run AppleScript’ action from the left into the right pane, copy-paste the script into the 'Run AppleScript action (replacing all the existing suggested code) and set the Service at the top to receive ‘no input’ in ‘OmniOutliner’ (scroll down after clicking Other…") Save as ‘Save to PDF’ or whatever.
This will add an item to your OmniOutliner > Services menu. Then make sure ‘OmniOutliner.app’ and ‘Automator.app’ are checked at System Preferences > Security & Privacy > Privacy > Accessibility.
And to attach the keyboard shortcut, go to System Preferences > Keyboard > Shortcuts > Services and type the shortcut you want in the right column next to ‘Save to PDF’ (or whatever you’ve named the Service). You have to make sure it doesn’t conflict with other shortcuts. Option-command-p did the trick here.
I just did a little test, and edited my KM macro to “Save as Adobe PDF”, and it actually added an extra step. After I chose “Save as Adobe PDF”, it opened a window asking for “Adobe PDF settings” and “After PDF Creation”.
Those don’t come up if one uses “Save as PDF” instead of “Save as Adobe PDF”.
“Save as Adobe PDF”, and it actually added an extra step. After I chose “Save as Adobe PDF”, it opened a window asking for “Adobe PDF settings” and “After PDF Creation”.
I don’t have ‘Save as Adobe PDF’ as an option. Maybe you have Acrobat installed?
Here ‘Save as PDF…’ works well, though. Step 3 of my 4-step sequence above gets me there.
@SGIII Perhaps you are on Sierra with its (shudder) PDF woes? I don’t think I had to do anything other than what David Sparks showed in that video (allowing for some minor OS version differences).
I can press Command-P again to get the save file dialog box. If instead I click the PDF button on the print sheet, I see these options. You can see I added Command-D to save to DEVONthink Pro Office as well.
I am on El Capitan using OmniOutliner 4 Professional. It works on the OO5 beta as well.
@TheWart I am indeed on Sierra, and am happy with it. No pdf woes here (though I was sad to note the demise of the ability to use convert on the command line to convert from rtf to pdf).
I have tested the 4 steps outlined above with OO5 (beta), and they work well. The GUI script that implements those 4 steps has no dependencies on KM or on staying with an old version of the OS. One keyboard shortcut (I’ve assigned option-command-p) and I’m done.