Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1 2 
Send Topic Print
Tinderbox to Omnioutliner to Scrivener (OPML) (Read 27002 times)
John Kendrick
Full Member
*
Offline



Posts: 66

Re: Tinderbox to Omnioutliner to Scrivener
Reply #15 - Jul 31st, 2011, 12:23pm
 
I should also add a thought or two more.

After working my way through this and then creating some sort of help files, I see, Lucas, that you suggested this be done on a small file first. I see that you added it later. I always try to do experiments that way at any rate. But thanks for the thought.

I will try it later on a larger file, though only as an experiment, just to see how it works.

I will also need to learn to put more material in the containers and less in the titles. Scrivener will like that. But so long as the export only worked with titles, they were longish.

John
Back to top
 
« Last Edit: Jul 31st, 2011, 12:23pm by John Kendrick »  
  IP Logged
Paul Walters
Full Member
*
Offline



Posts: 267

Re: Tinderbox to Omnioutliner to Scrivener
Reply #16 - Jul 31st, 2011, 12:45pm
 
I do a lot of OPML exporting from Tinderbox, to Scrivener and elsewhere.  I'd suggest the code that Lucas and Mark designed (for the "OPML-Item" template) can be simplified, as follows:

Code:
<outline text="^value(attributeEncode($Name))^" _note="^value(attributeEncode($Text))^" _status="^value(attributeEncode($Checked))^">
^children(/Templates/OPML-item)^ </outline> 



There's no need to put the indents in an OPML file.  It's the nesting of <outline /> elements that handle indenting, and Tinderbox, OmniOutliner, Scrivener, etc., understand that when they parse the file.   There's no need to have the existence tests for attribute content (the "if..." statements), because empty attributes in OPML are just passed over by the parser.  And there's no need to check for children, because the above code will capture children from zero to infinite depth.
Back to top
 
« Last Edit: Aug 1st, 2011, 4:59am by Paul Walters »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Tinderbox to Omnioutliner to Scrivener
Reply #17 - Jul 31st, 2011, 5:41pm
 
Further to Paul's points, it is also not a requirement to use <tag/> for a tag with no children, <tag></tag> can be used as well (indeed that is what his example does). But, as anyone who's tried debugging broken OPML can attest, using indented code makes it much easier to see the closures.
Back to top
 
 

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



Posts: 66

Re: Tinderbox to Omnioutliner to Scrivener
Reply #18 - Jul 31st, 2011, 7:56pm
 
In my case, my test file only works with Lucas' code. Perfectly.

The children and the container material don't make the trip with Brad's code.

I entered Brad's code in the OPML-item file, then tested the results by passing it through Omnioutliner and on to Scrivener; and a second time taking the file directly to Scrivener. Lost the children and the container contents both time.

I recall Jean found that Lucas' code worked and Mark's did not. Someone observed that opml coding is famously varied. And I think I read somewhere that Omnioutliner's opml code is a bit specific. Since Scrivener says they want to make certain outlines from Omnioutliner can be imported into Scrivener, perhaps somewhere in there lies some sort of an answer.

I'm now trying to find ways to streamline the process so I don't have to copy and paste those template notes from file to file. Or, if I have to, I find a way to cut down the steps.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Tinderbox to Omnioutliner to Scrivener
Reply #19 - Aug 1st, 2011, 7:16am
 
I think the real underlying problem for @John was an unclosed <outline> tag since when we've been going round in circles. After a morning spent tinkering with OPML I've found some other things (e.g. here re checkbox info) but I think they aren't the issue. I now want to get a code test that I know works verified by John so we can move forward. As a result, I've updated my previous "OPML-for-Scrvener" TBX (right click link and Save as). I've also uploaded the OPML output that it exports: NewOPMLTest.opml (right click link and Save as). The TBX looks like this:



The file's set up so only "New OPML Test" exports, so it's just a mater of opening the file and using File -> Export as HTML. The use of accents, angle brackets and such us deliberate - they're there to test encoding works correctly. I've also added as an alternate, a new pair of templates based on Paul's suggestion further above although please be aware that to use the latter you'll need to make the template assignment changes described in the TBX's help note "The 'Simple' templates".

John, could you please try the above (specifically the files linked to in this post not earlier ones) and tell me if it works for you? I'd welcome another Scrivener user giving a report on whether this works.

I want to ensure we've got export working for John and then , in my admin 'hat' I'll prune or possibly simply delete this thread and write up the successful result. In doing so, I'm not dismissing the help of various forum members here but I'm just conscious that subsequent readers need to work through a page and a half of what doesn't work to get to a solution.  Thought I'd flag the latter as coming - I don't want anyone thinking they're in some way censored.
Back to top
 
« Last Edit: Aug 1st, 2011, 7:20am by Mark Anderson »  

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



Posts: 136
North Carolina
Re: Tinderbox to Omnioutliner to Scrivener
Reply #20 - Aug 1st, 2011, 8:58am
 
"Simple" still isn't working for me (for OmniOutliner).

Mark, I have no complaints about "censorship."  But sometimes it is very educational to read a thread developing--not just the end result.  At a minimum, could you save LucasD's fine set of instructions?
Back to top
 
 
  IP Logged
Paul Walters
Full Member
*
Offline



Posts: 267

Re: Tinderbox to Omnioutliner to Scrivener
Reply #21 - Aug 1st, 2011, 9:02am
 
Jean, what flavor (pro, not pro) and version of OO are you using?  Does it give an error message?  If you export the OPML from Tinderbox, and then try to open it as a new Tinderbox document, does it work?

I'd agree that I'd rather see this thread left intact, and maybe the final answer posted on a locked, sticky thread - or the Cookbook (is the Cookbook actually maintained these days?).
Back to top
 
« Last Edit: Aug 1st, 2011, 9:04am by Paul Walters »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Tinderbox to Omnioutliner to Scrivener
Reply #22 - Aug 1st, 2011, 10:01am
 
Is the CB maintained? Yes. I, amongst others, certainly add new tests as new features are added.  The only thing missing perhaps is a way to automate publishing of the changes as I notice CB source is at v5.9.2 but the online pages are still for v5.8.0.

A harder issue to work around is that date/date coercion based tests rely on the user's locale settings. Currently many of the tests - because I wrote them - use UK settings so I can check things work. It has to be that way as I have other important processes running that won't cope with me me switching my Mac's locales. I've stated looking at a way to at least make the CB tests have, say US and GB locale version though one set will always fail in the HTML depending on the users locale - indeed both might fail if run out elsewhere.  I don't see a way round that as the test strings are hard coded (deliberately).

As to the other stuff, comments noted. Anyway, that's later. Has anyone tested the file I posted and successfully imported into Scrivener. I'm pretty happy that TB<->OO works fine (barring the checkbox side-issue noted in a separate thread). We still need to prove there aren't glitches in the Scrivener OPML import using a common test done by several people. I'm not suggesting a fault, but think it sensible to allow for the possibility before happily telling users who don't want to fiddle with export to "just do X and all will work".
Back to top
 
 

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

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Tinderbox to Omnioutliner to Scrivener
Reply #23 - Aug 1st, 2011, 10:05am
 
A difficulty with some threads (I've not been following this one closely) is that they fill up with confusing, irrelevant, or obsolete information.  The result is that people today decide not to use Tinderbox because of something that someone erroneously claimed was impossible in 2007.

As I believe I said earlier in the thread:

(a) OPML export from Tinderbox is should not be difficult
(b) We're looking into even better export tailored to Scrivener
Back to top
 
 
WWW   IP Logged
Paul Walters
Full Member
*
Offline



Posts: 267

Re: Tinderbox to Omnioutliner to Scrivener
Reply #24 - Aug 1st, 2011, 10:11am
 
Quote:
Mark Anderson wrote
Has anyone tested the file I posted and successfully imported into Scrivener[?]


Yes and Yes.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Tinderbox to Omnioutliner to Scrivener
Reply #25 - Aug 1st, 2011, 10:18am
 
Many thanks. Just hopefully get a yes from John and I can sort this thread out.

P.S. A polite request from your moderator that others than John do not add to this thread now as I'll be re-factoring it once I know it he's got the correct code working.
Back to top
 
« Last Edit: Aug 1st, 2011, 11:22am by Mark Anderson »  

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



Posts: 66

Re: Tinderbox to Omnioutliner to Scrivener
Reply #26 - Aug 1st, 2011, 3:16pm
 
Mark,

I just saw a reminder to this thread in my email but can't get to work on Tinderbox until this evening. I'm on the road and will have not time to do anything.

As for working, I'm quite comfortable with Lucas' solution. It worked perfectly, not only on the fairly short tbx file I exported yesterday but a longer one last night.

I do appreciate your effort, however. As for keeping the thread, let me offer another vote to do so. It helps to see how folk work through these issues. And it also helps to see the level both of the support tbx provides but also the work of a vibrant user community.

Back later,

John Kendrick
Back to top
 
 
  IP Logged
John Kendrick
Full Member
*
Offline



Posts: 66

Re: Tinderbox to Omnioutliner to Scrivener
Reply #27 - Aug 1st, 2011, 8:16pm
 
I'm back later with mixed results, Mark. The export file you linked in your text imported directly into Scrivener just fine. No use of Omnioutliner. The children showed fine and the text in the containers as well. Good work.

Not so good with the second material, the full TBX file that included your code. I did an export with it via html, as you suggested. Scrivener didn't like it as a file import. Error message was:

Some files could not be imported because they were of an unsupported file type or contained data that could not be read.

If, however, I exported that file as text using the Simple Wrapper template, it worked just fine. Perhaps you mistyped those instructions.

So, in summary, the code works fine. So long as you use the "text" export button on the templates associated with it. But doesn't work with the html export option.

Thanks again for all the attention to this.

John Kendrick

(Later edit) I continue to want to vote to keep this thread as is. It's a terrific illustration of good customer support and, as I said, a vibrant user community.
Back to top
 
« Last Edit: Aug 1st, 2011, 8:37pm by John Kendrick »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Tinderbox to Omnioutliner to Scrivener
Reply #28 - Aug 2nd, 2011, 4:10am
 
Resolved at last. It appears that the TBX had somehow got its template assignments messed up (and wasn't exporting OPML) and was using the 'plain' built-in template which is understandably why the Scrivener import failed in John's test. I had been worried there might be an issue the Scrivener end but finding this export configuration glitch, which was user - me not John - and not app error, all seems to fall into place given that the specimen OPML export did work.

The glitch didn't show in testing (for reasons perhaps for a thread another day) before upload but was immediately obvious on re-downloading it and looking at the export in HTML view and in the exported source code. Of course, for John who's not looking at source code the glitch simply wouldn't be apparent, so confusion isn't surprising on his part. The same TBX file, re-tested and re-uploaded again(!), now produces the expected OPML which already I know from John's report does work. Test complete!

John, please throw away your existing OPML-to-Scrivener.tbx and re-download it. You will find it will now work.

Wow, all this from one missing '/' ... and in misdiagnosing that a lot of false trails. But there at last  Smiley

Anyway, this thread is now locked. Please start any new OPML discussion in a new thread (the "Exporting from Tinderbox" sub-forum seems the most logical place).

Meanwhile, I'm working on some OPML export example files for both inexperienced and more seasoned users. It may be a few days to get done; 90% of the time is the explanatory notes, etc. Until then, today's revised TBX should suffice.
Back to top
 
 

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

User - not staff!

Posts: 5689
Southsea, UK
Re: Tinderbox to Omnioutliner to Scrivener (OPML)
Reply #29 - Aug 2nd, 2011, 4:15am
 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Admin note: Thread resolved and locked. After a trip around the houses, a working OPML export example is here.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1 2 
Send Topic Print