OmniOutliner and Scrivener question

Can anyone think of a solution to this problem, please?

I have always prepared my lectures starting in OmniOutliner Pro, which, apart from being brilliant outliner has, for me, the ultimate nifty feature that it will export to a very basic Keynote format, as well as to RTF and OPML.

In the past, I have created my lecture structure in OOPro, with the slide headings as level 1 rows and the body of the slide as level 2 rows. When that’s been done: (i) I have exported it to Keynote and then tweaked the presentation using a theme I have created, or rather modified from the Apple original, and my presentation is done; (ii) I have exported it to RTF which I’ve opened in Nisus, got rid of all the level numbers and other bullets/whatever, removed the headings where necessary and worked on it, expanding it adding examples and explanations that form the oral part of the presentation. That I have printed to PDF and made available to the students so they can’t claim they didn’t follow what I was saying.

That’s all fine, but the question/problem is this … I’m now having to produce a couple of completely new lecture courses, and I thought, “Great, I can use Scrivener for the written part! OOPro exports OPML; Scrivener can import OOPro’s OPML, that’s how I’ll do it!” Nope, doesn’t work.

Thing is, Keynote wants that basis for the body text as level 2 rows in OOPro; Scrivener wants that body text basis as a note appended to the level 1 header row. Level 2 rows of the OPML, in Scrivener become new documents, with however much of the text as can fit in the document title, but the body of the document empty.

Any suggestions as to how I can reconcile these two different requirements of my downstream software? Yes, I can export to RTF, import that, remove the bullets etc, split the one long document into lots of smaller ones, but the bullet removal etc. is much easier done through NWP’s PowerFind Pro and it’s time consuming to go into NWP just to do that and then re-import the document into Scrivener, when it’s going to be compiled out in RTF to go into NWP anyway.

So, guys and gals, any suggestions? How do I get OOPro set up so that it’ll export to both Keynote and Scrivener without a lot of mucking about with RTF by going through OPML.

Ta muchly.

Mark

I would use a perl (or sed for the purists) command or two to make the changes as a filter that you would run post export from OOP to get a scrivener compatible file. Not having OOP I can’t suggest the exact method to do this.

And if you don’t like running “scripts” you can create an automator workflow to hide the ugly parts.

Another thought would be apple scripting the change L2 rows to the needed format. Not sure that OOP would support that though. This would create an extraneous OOP file but …

I like the first option better.

I bet Amber will pop along and point out a 1 click solution to the whole problem though. It is like her to do that. :wink:

Could something like that be done for this forum?

Probably.

Biggest problem is the lack of OOP on my side. If someone could provide me an export file that works properly with Keynote and one that works properly with scriv (preferably from the same source OOP file) that would be a big help.

I think you might have missed my point as regards the possibility of automatically hiding this forum’s ugly parts…

Yes. I see. I don’t think keeping vic-k in a box is a good idea (even though many may approve). I am already attempting to accommodate your request -->

The Superlative and the Sublime…

…and such under stating. :wink: :slight_smile: :smiley: :laughing: :stuck_out_tongue:

In three posts we have gone from on topic attempts to assist a scriverati to an entirely off topic commentary regarding the anti-prettiness of certain forum participants. Those moderators really need to be forced to read a stack of vic-k’s posts. That will inspire them to action.

Thanks, Jaysen. I’m going to risk the wrath of our forum multiple-personality by going on-topic again …

I had thought of duplicating the body-text info in both a level one note and a level 2 entry. Scrivener would use the former from the OPML version; the Keynote export would use the latter. On the other hand, while Keynote would ignore the notes, Scrivener would turn the level 2 content into separate docs with merely a title consisting of the first few words, potentially some 30 or so documents that I’d have to go and delete.

I can, with only a little work, produce you the two types of OPML file. But I know nothing of PERL; Sed to me is the Latin for “but”; and I have never attempted AppleScript.

I have also just thought — after a good night’s sleep for once — that I should throw the question at the OmniOutliner forum … there are some Amber-tinged people there too. :wink:

Mark

[EDIT] I’ll need a little time to produce the files … busy, busy, busy!

The perl and/or sed would ideally be a script that you would never need to look at. Same with the automator.

But feel free to go the smarter folks. I don’t mind. sniff

Eternally modest Jaysen,

I realise I would not have to look at the script; my point was that, unlike you, I wouldn’t have the foggiest idea about how to create it! What I have done is create an OPML file from a Keynote compatible OmniOutline (TS4.opml), and a Scrivener compatible OmniOutline (TS4-2.opml) which I have zipped up and attach so you can see the difference. I have looked at them side-by-side in TextWrangler — I am just enough of a geek to have a copy of that though I hardly ever use it … sometimes on text files where I want to do a lot of complex find-and-replace, though NWPro PowerFind Pro is easier.

The difference between the two seems to me to be clear and straightforward, but writing a script to do it in whichever of those languages is beyond me. If you can do that and give me instructions how to make an automator action out of it, so that when I export a TS4 type OPML file into the appropriate folder, it will automatically be converted into a TS4-2-type OPML file, my gratitude would be boundless.

:slight_smile:

Mark
OPML files.zip (6.06 KB)

This shouldn’t take too much, but will need to wait for me to wake up tomorrow. I will be using 10.5 but there should be nothing “magic” that will prevent this from working on 10.6. Let me get something together for you then I will tell you what it does.

Well, that was a bit more interesting than I anticipated.

I have attached an “application” that you can just double click and run, and the actual automator that you can modify as you need (for those masochists who need yet another reason to laugh in my general direction, the perl is embedded in the automator – that is probably stupid, but … you needed a laugh).

Oh, and I expect you might find an error in the import under some conditions. The file you sent me was unusual but the output form the script and the same scriv compatible file imported the same for me.

Let me know how it goes.

Convert OPLM for Scrivener.zip (146 KB)

Edit: BTW your files need to have the extension opml. The script will make a new file link file-scriv.opml. It will happily overwrite any previous file-scriv.opml. Figured I should tell you that as well.

Hi Jaysen,

Thank you so much for this. I’m sorry not to have replied sooner, but I haven’t had time until this morning to look into your script. I have been trying the application, with interesting results; I wanted to make sure I could get it working before I tried to work out how to use the automator version and attach it as a folder-action.

Hmm … with the file I sent you, when I ran the converter, neither Scrivener nor OOPro would open the resulting file, Scrivener failing to import it as there was something unreadable, OOPro saying it was not valid OPML. So I had a look at the two files in TextWrangler.

The first thing I saw was that in the converted one the line had a string of numbers separated by commas in it, which the other didn’t, so I deleted those, saved and tried importing. No joy. (They are to do with the expanded/unexpanded state of the rows in OOPro, I realise.)

I then zapped gremlins, in case there was anything like that left in … no joy.

So I printed them both out, to make it easier to compare them in detail, and the print showed that at the end of the text, the last bit in the converted TS4-scriv.opml had:

... the need for adjustments."<
The greater ...

Whereas my TS4-2 has:

... the need for adjustments.
The greater ...

The text in TextWrangler changed colour at that point, indicating that that was where the problem was. Deleting the "< resolved it, and Scrivener imported the file happily.

I tried re-exporting the OOPro TS4 file to OPML, but it had the same error when converted. I tried exporting the outline for another lecture, an outline of a totally similar type to TS4, and it converted faultlessly and imported into Scrivener just as I wanted. So I have no idea why, in the case of TS4, that "< is getting left in by the converter in that single case, whereas no errors of that kind are occurring in TS3.

I’m now going to try setting up the automator, knowing that odd errors may be thrown up, but also knowing to look at them under TextWrangler and to be able to spot the sources. If I find any intractable problems, I’ll let you know.

So boundless gratitude is yours.

Mark

hmm… I think that is in one of the third level sections. Those were particularly problematic. Let me look at it tomorrow and see if I can figure out where it is falling apart. Sorry about that.

Mmm … no rush. It’s going to be a week or so before I need to write the next outline … the students are having an interlude of working on translation, and then I’m going to be able to make use of material from another lecture course which this is superseding. Oh, and it is the first of the level 3 sections that that error is happening on … the others which follow come out as should be. Seems bizarre to me.

As for automating the whole thing, I’ve set up an automator thing that tells automator to look in the appropriate folder and if it finds a file dated “today” it runs the converter and then a growl notification comes up to say it’s done. But there are two things that I can’t work out.

One is where the hell I should save it to … at the moment it’s in my “temp” file on the desktop … that’s where downloaded zips get expanded to, but it ought to have a better home. I don’t know where the automator library is … can’t find that … it’s not in either of the /library/application support/ folders.

Second, I have set automator to load on log-in, but I still have to load and run the converter manually from there. How do I set it as a folder action, so that when I save an OPML file into that folder, it will just run without me having to do anything more?

Many thanks
Mark

Looking at it again, actually, that "> code-fragment is at the end of the level 2 item where the level three items are going to start. It is anomalous in that it is the only point where what I presume is a line-break character is preceded by the remaining code from the original, so I guess that, if a file fails to import into Scrivener, rather than looking through the file carefully, I could just run a search for all instances of "> and replace them with and only if it still fails look carefully for any other anomalies.

I guess it’s too crude and inelegant just to code that search and replace into the end of the script run by automator! :slight_smile:

Mark

Actually the code “should have” looked for multi level. The file you sent me drove me batty until I realized the difference in multi-level ending. I thought I had that worked out. It should be a quick fix and no more than a 1 line add. I just want to make sure I put it in the right place.

Done.

Try this. Same work methods as last time. Just smarter.
Convert OPLM for Scrivener.zip (142 KB)

Jaysen, this is great. The automator as sent does just what I want when I ran it manually. Then I spent a while yesterday mucking around in automator itself and worked out how to make a folder action attached to the right folder and that worked fine, except …

it took x.opml and created x-scriv.opml … and then it went on to re-create x-scriv.opml and produce x-scriv-scriv.opml, and then x-scriv-scriv-scriv.opml and then …

So what I need it to do, and everything will the be truly bright and shiny in my world, is to save out the x-scriv.opml into a different folder so that the folder action won’t find it and go into action again. If it’s not too arduous a thing to change, just let me know where and how to modify the perl script so that it saves the -scriv version into preferably a sister folder to the one where the source opml is, or if it’s easier to a daughter folder, either of them called Scriv … I’ll create whichever folder will work.

And the boundlessness of gratitude is rapidly losing its boundaries :smiley:

Mark