Welcome, Guest. Please Login or Register
Tinderbox
  News:
Tinderbox 6.0.2 is now available.  (download)
  HomeHelpSearchLoginRegister  
 
Pages: 1 2 
Send Topic Print
OPML for Scrivener import (ex:Notes for a Novel) (Read 27654 times)
AsafKeller
Full Member
*
Offline



Posts: 69

OPML for Scrivener import (ex:Notes for a Novel)
Dec 31st, 2009, 12:29pm
 
HTML might be considered "easy", but, unless I am missing something, it does not retain the outline order; the exported folders and files are sorted alphabetically. The copy/paste approach is nice, but it does not create the individual files I would like to import into Scrivener, nor does it transfer the contents of the notes. A simple, user-friendly OPML export would be great.
Back to top
 
« Last Edit: Jan 02nd, 2010, 11:09am by Mark Anderson »  
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2285
Eastgate Systems, Inc.
Re: Notes for a Novel
Reply #1 - Dec 31st, 2009, 12:37pm
 
Your HTML export may be in any order you like, though the most natural order is, in fact, the outline structure.

OPML export is just a special case of HTML export -- several OPML templates have been posted in the forum and (if I recall) in the public file exchange.  I'll be away from the office for the next few days, visiting my aged mother; if you can't find the templates in the meantime, drop my an email next week and I'll dig them up.
Back to top
 
 

Mark Bernstein
WWW eastgateSystems@mac.com   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4469
Southsea, UK
Re: Notes for a Novel
Reply #2 - Jan 1st, 2010, 1:36pm
 
Asaf, Exported HTML files never have an order in the way your describe it - they are just files. It is the links within the HTML themselves that give effective structure. OPML is just another form of mark-up (like HTML, XML, etc.) only less standardised than HTML. The latter fact means you need to plan which parts of your TBX need exporting - TB can't always guess your intent.

Please download and try this demo TBX file which shows how to do OPML export. Do the demo and see if the output imports correctly into Scrivener (an app I don't have/know). If so, just copy the 2 templates used by the demo across to your own documents (you can drag-drop between TBXs). If stuck on how to use the templates in your own TBX, do ask back here. Tip: to help us help you in the latter case, it would be useful if you post a small specimen TBX showing your style of TBX layout so we've a common reference.

Everyone does their export a little differently, so don't be downhearted if your first guess at wiring up your own TBX for OPML export doesn't work. I'm sure we can help.
Back to top
 
« Last Edit: Jan 2nd, 2010, 9:55am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
AsafKeller
Full Member
*
Offline



Posts: 69

Re: Notes for a Novel
Reply #3 - Jan 1st, 2010, 7:23pm
 
Mark: The template creates an opml file that exports flawlessly into Scrivener. Thanks much! The only thing I am having difficulty with is modifying the template so that the contents of the notes, and not only their title, are also exported. Thanks so much for your helpful, speedy and courteous response!
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4469
Southsea, UK
Re: Notes for a Novel
Reply #4 - Jan 2nd, 2010, 5:28am
 
OK, I've prepared a new demo. NOTE: I don't believe OPML was really intended for multi-paragraph data like this so if it doesn't work you might need to look at using a different format. Let us know if this works.

Also, if this doesn't work, please post an example of an OPML file that does work as you expect.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
AsafKeller
Full Member
*
Offline



Posts: 69

Re: Notes for a Novel
Reply #5 - Jan 2nd, 2010, 6:13am
 
The new template does not export the notes' contents. Here is a small opml file I created with a demo of OmniOutliner; it correctly exports 'note' contents into Scrivener. Code:
<?xml version="1.0" encoding="utf-8"?>
<opml version="1.0">
  <head>
    <title>test file</title>
    <expansionState>0,2,3</expansionState>
  </head>
  <body>
    <outline text="1 Level A" _note="this is the text that will go here">
      <outline text="1 Level B"/>
    </outline>
    <outline text="2 Level A">
      <outline text="2 Level B">
        <outline text="2 Level C"/>
      </outline>
    </outline>
  </body>
</opml>
 

Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4469
Southsea, UK
Re: Notes for a Novel
Reply #6 - Jan 2nd, 2010, 9:54am
 
Well, the OPML exports from Tinderbox as asked for so the error is on the Scrivener end. The code you post proves the point. OmniOutliner is exporting 'text' in a non-standard OPML <oultine> attribute called '_note'. Scrivener has clearly been hardwired to use Omni's private extension to the OPML. I did look at the Scrivener site and its manual but the latter neglects to mention how its OPML import works and what OPML extensions it requires; you might help yourself by posted a request on the Scrivener forums that they add something to the manual about OPML; if the app expects non-standard input it helps to know what the variations are.

I've posted another demo that - based on the OO example to give above - outputs code that is compatible Scrivener custom OPML extensions.

(Tinderbox can't create the <extensionState> tag as the export code doesn't give access to that info but again, the tag is a non-standard Omni addition to OPML.)
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
AsafKeller
Full Member
*
Offline



Posts: 69

Re: OPML for Scrivener import (ex:Notes for a Novel)
Reply #7 - Jan 2nd, 2010, 12:42pm
 
Quote:
you might help yourself by posted a request on the Scrivener forums
I shall do that. Again: thanks much for your help with this!
Edited:
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4469
Southsea, UK
Re: OPML for Scrivener import (ex:Notes for a Novel)
Reply #8 - Jan 2nd, 2010, 1:07pm
 
I think the last demo ought to solve the problem as I've fixed the TB OPML export to mirror that of OmniOutliner (OO).  The problem may be if you are putting more than one paragraph of text in your TB notes and XML (the code used for OPML) created doesn't sit well with Scrivener's XML parser. Anyway please tell me how you got on with the last demo I made for you (OPML-for-Scrivener.tbx). Specifically, you need to try the export/import process with TB notes that have zero or one paragraphs of text, before trying export with notes that may have greater than one paragraph of text. Let me know the results of that.

I appreciate you don't want to get involved in the tech side of this, but unfortunately you're asking for something for which there isn't a simple answer. A 'universal translator' is still in the realms of science fiction! The problem here is you want a push-and-go solution for something which doesn't use a consistent syntax.

My hunch is Scrivener has a kludge to accept whatever OO's OPML output is.  Hover, the latter';s not documented. Can you make an OO note with more than one paragraph of text and successfully get it into scrivener.  If so I'd need to see the file (not just the code pasted into a forum post) so I can see how OO deals with paragraph delimiters.

If OO OPML only imports to Scrivener only works when there's one paragraph of text then that's a limitation on the Scrivener end that we can't work around here.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
AsafKeller
Full Member
*
Offline



Posts: 69

Re: OPML for Scrivener import (ex:Notes for a Novel)
Reply #9 - Jan 2nd, 2010, 1:41pm
 
The OPML-for-Scrivener.tbx failed to transfer text even when it originated from notes having only a single paragraph. Perhaps these posts from the Scrivener forum would be helpful? http://bit.ly/6zTu2F
Thanks again.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4469
Southsea, UK
Re: OPML for Scrivener import (ex:Notes for a Novel)
Reply #10 - Jan 2nd, 2010, 3:20pm
 
It looks like there's already a solution as quoted here, in the Scrivener support thread. AmberV - the forum moderator over at Scrivener support forums - is also a Tinderbox user and pretty code savvy.  My hunch is this is a problem better followed up on the scrivener support forum. TB can emit HTML, XML, OPML, etc., but what we don't know is what Scrivener will import. From the app's author's comments it doesn't parse any OPML but rather only a very particular layout.

The forums at Scrivener sound pretty helpful so I think that's your best bet at this point.  If you know exactly what's needed but not how to produce it, call back here and we can have a go at making something suitable.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4469
Southsea, UK
Re: OPML for Scrivener import (ex:Notes for a Novel)
Reply #11 - Jan 2nd, 2010, 6:11pm
 
Asaf, I got the file you sent.  It looks like we need to find a way to coerce TB note text paragraph breaks (carriage return character) into XML entity "&#10;". I'm not sure of any of the existing action or export codes do this. I think TB does it for OPML import - you might want to check directly with Eastgate support..
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
AsafKeller
Full Member
*
Offline



Posts: 69

Re: OPML for Scrivener import (ex:Notes for a Novel)
Reply #12 - Jan 2nd, 2010, 7:58pm
 
Thanks. I sincerely appreciate your efforts on this.
Keith, author of Scrivener, is keen to resolve the TBx-->Scrivener export issue. How do I get you folks to talk directly?
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 4469
Southsea, UK
Re: OPML for Scrivener import (ex:Notes for a Novel)
Reply #13 - Jan 3rd, 2010, 5:38am
 
I'm just a community helper here - a fellow TB user (I don't work for Eastgate). The best thing might be for Scrivener's author to contact Eastgate directly via email. Though I don't use Scrivener myself I'm aware a number of Tinderboxers do use both apps. I suspect 'all' we need is an extra action code to do the line break -> vertical tab transform.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v5
(TB consulting - email me)
WWW shoantel   IP Logged
Ioa Petra-ka
Full Member
*
Offline



Posts: 103
Portland, Oregon, USA
Re: OPML for Scrivener import (ex:Notes for a Novel)
Reply #14 - Jan 10th, 2010, 10:05pm
 
I still maintain that the best way to get a book-like structure from Tinderbox to Scrivener is via the HTML exporter engine. I have posted new, detailed instructions in the Scrivener forum in response to the sister thread, here:

http://www.literatureandlatte.com/forum/viewtopic.php?f=2&t=7244&p=59063#p59...

Using the method I describe, you'll have a fully retained outline order, rich text with long document support, and styled titles. The method is simple enough that it could be tweaked fairly easily to produce different results. There are sample files provided, and using those you can see how you can from from Tb to Scriv in ten seconds, once you have the system built.

The only downside to the method is that by working around file system definitions, titles become somewhat generic and numbered. This may or may not be a deal breaker, but if you keep your titles short (very short), you may still be able to work something in by adjusting the scene and chapter rules to `$HTMLExportFileName = $SiblingOrder + " - " + $Name`
Back to top
 
 

Av
  IP Logged
Pages: 1 2 
Send Topic Print