The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniOutliner > OmniOutliner 3 for Mac
FAQ Members List Calendar Today's Posts

 
Export rows as separate files Thread Tools Search this Thread Display Modes
Greetings,

is there a way to export the rows of an outline as separate RTF-files? I'd like to take random notes in OO and then be able to have each note as an individual file that I can then archive in Eaglefiler.

I'm sure it's possible using Applescript and I just glanced over OO's Applescript library, but having only little experience with Applescript I'm asking here first before I'm going to dive further into this.

Thanks for any suggestions, hints and help,

Markus
 
How fortuitous! I wrote a script to do exactly this the other night. I don't have access to it at the moment, but it should be almost entirely reusable for your purposes. Sorry for the tease, but I'll post it later this evening or tomorrow once I've got it in front of me again.
 
Here we are. I've removed the things specific to my purposes and made it a little more generic.

To use it, open your outline as the front document and either run it from Script Editor or the scripts menu. It will create a folder on the desktop called "Rows-To-RTF" (which you can change in the script) and create an RTF file named for each top-level row/section with all of it's notes and sub-rows within.

As it is, you can't point it anywhere but the desktop, but I'll probably fix that later. As the filename is taken from the row text, it may also fail if the row is too long. I don't know how you lay out your files, but mine are usually short row names with long notes.

I used plain text for my exporting, so I haven't thoroughly checked to see if any formatting is lost, but in my tests it all looks fine.

Let me know if there any tweaks that might make it better.
Attached Files
File Type: zip Export Rows to RTF Files.zip (4.6 KB, 756 views)
 
Quote:
How fortuitous!
Indeed! This is almost perfect, thank you very much.

Eaglefiler maintains a folder for automatic import and I managed to point the script to that folder. I also adapted my notes-template to suit the format of your script (row title & note content), which is entirely reasonable to me. It's working fine so far.

What I've yet to find out is how to keep the style settings of my document. In my document the row font and the notes font are the same (Charis SIL regular), and there are no handles, no checkboxes and no column titles. The exported documents show do show the row names in the correct font, but there are column titles, checkboxes and the notes contents are shown in Helvetica italics.

Since your script creates a temporary file for each row, I assume you are referring to a template of yours in the line
Code:
export it to saveFile as "OORTFPboardType"
Is this the right place to investigate further in order to keep my formatting?

You say you're using plain text for exporint your notes. In fact, my current notes system is based on plain text files indexed by Devonthink, but I'm trying out Eaglefiler and RTF-notes now, since I want to abandon Devonthink for several reasons. I like the idea of having the clickable links that come with RTF, but I'd be totally fine with (and used to) plain text notes if that would make things easier. At least for now – customising your script is a perfect entry into Applescript.

Markus
 
The export command for OmniOutliner is a little weird. "OORTFPboardType" is the string you have to feed it to export as RTF. I'm sure it's documented somewhere, but I only found it by doing:

Code:
tell application "OmniOutliner Professional" to return writable document types
If you ever decide you want to use plain text again, the three plain-text exporters are:
"NSStringPboardType" - Columns separated by tabs,
"OONeatoStringPboardType" - Fixed-width columns,
"OOMORETextDocumentType" - MORE 3.1-style.

Be sure to change the extension in the script if you're going to switch to plain text. Maybe I'll get around to updating the script to switch between them.)

The trouble with the formatting lost is that when you create a new document from AppleScript, OmniOutliner ignores your default template and uses the apparently hard-coded one it defaults to when first installed. Only styles that are part of the individual rows get copied, everything else comes with the template.

The best solution I can see is to just open a template instead of creating a new temporary document. Unless you're using a lot of differently-styled documents, this should be fine. All of the inline styles will still be copied as they are now.

Place this (or an alias to whatever other template) at the top of the script.
Code:
set template to alias ((path to application support from user domain as string) & "OmniOutliner 3:Templates:Default.oo3template:")
Then, replace "set newOutline to make new document" with:
Code:
open template
set newOutline to front document
 
Now it works as expected, this is exactly what I was looking for. Great!

Thank you very much for your help. :)

Markus
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
Export each object automatically as separate PNG files PipSqueak OmniGraffle General 1 2013-02-12 03:38 PM
Numbered rows in OPML export (perhaps via Applescript?) mjknight OmniOutliner 3 for Mac 0 2011-12-16 08:15 AM
Applescript to export each active project to a separate CSV signal15 OmniFocus Extras 0 2009-08-05 12:52 PM
Select or Export Styled Rows Stan Hudson OmniOutliner 3 for Mac 1 2009-06-26 01:37 PM
Color Striping Rows and Dynamic HTML Export grahama OmniOutliner 3 for Mac 0 2007-12-08 05:54 PM


All times are GMT -8. The time now is 03:45 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.