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 27006 times)
John Kendrick
Full Member
*
Offline



Posts: 66

Tinderbox to Omnioutliner to Scrivener (OPML)
Jul 30th, 2011, 10:20am
 

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

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

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


I would like to be able to move material from Tinderbox to Scrivener, without writing scripts. So I've been reading both forums to see whether it can be done and, if so, how. Here's my understanding at the moment, after trying several illustrations. If this is not accurate, please let me know.

1. Tinderbox outline formats can be moved from TBX to Omnioutliner via copy and paste. Just the headlines; not the contents of the containers.

2. Omnioutliner outlines can be moved to Scrivener, both headlines and contents of "containers." That's done via OPML. Save the file as OPML, then import into Scrivener.

I can see no easy way, short of scripts, to move the contents of TBX containers to Scrivener, save manual copy and paste of the contents of each container.

Is this the state of moving TBX info to Scrivener at the moment?

Thanks in advance for any help,

John Kendrick
Back to top
 
« Last Edit: Aug 02nd, 2011, 4:15am by Mark Anderson »  
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Tinderbox to Omnioutliner to Scrivener
Reply #1 - Jul 30th, 2011, 10:31am
 
You could easily use OPML templates, much discussed here, to effect the export. No scripting is needed.

And it's quite easy to write any export template you like. Again, no scripting. (templates can seem complex at first, but most are very simple)


[edit: opal -> OPML]
Back to top
 
« Last Edit: Jul 30th, 2011, 11:42am by Mark Anderson »  
WWW   IP Logged
John Kendrick
Full Member
*
Offline



Posts: 66

Re: Tinderbox to Omnioutliner to Scrivener
Reply #2 - Jul 30th, 2011, 2:45pm
 
You could easily use OPML templates, much discussed here, to effect the export. No scripting is needed.

Greetings, Mark. Can you direct me to some information on how to do that. Is there a template already prepared? If so, where is it and how to I use it to export? If not, are there some directions somewhere as to how to prepare a template to export via OPML?

Thanks in advance,

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



Posts: 133

Re: Tinderbox to Omnioutliner to Scrivener
Reply #3 - Jul 30th, 2011, 3:17pm
 
Hi John,

I cannot provide any expertise on how to do this, but as a starting point, there is the following relevant information (including templates) in Mark Anderson's aTbRef:

http://www.acrobatfaq.com/atbref5/index/ImportExportFormatting/OPMLExport.html

I think this is also crucial:

http://www.acrobatfaq.com/atbref5/index/ImportExportFormatting/Notescanbeexportt...

However, I had a go at it and was unsuccessful, so perhaps this is a good opportunity to clarify the exact steps needed. In order to get the resulting OPML files to open in OO, I had to manually add some missing slashes. (I figured this out by creating an identical outline in OO, exporting to OPML, and then comparing the two OPML files.) But anyway,  the problems I ran into may have been a result of not properly understanding Mark's instruction regarding "taking care to encode for XML standards and to encode paragraph breaks in $Text."

If I make further progress in troubleshooting this I can post back.
Back to top
 
 

WWW   IP Logged
John Kendrick
Full Member
*
Offline



Posts: 66

Re: Tinderbox to Omnioutliner to Scrivener
Reply #4 - Jul 30th, 2011, 4:56pm
 
Lucas,

Thanks for the experimental work and for passing it along. That's precisely, however, what I'm hoping to avoid. And I'm sufficiently eager to avoid it that I might not use TBX for the early, data gathering portions of the project. It's far and away the most powerful tool for such but it remains terribly difficult to get the information to my writing platform, Scrivener, without lots of manual copying and pasting.

I had hoped for something easier. I haven't given up and will take a look at the links you've provided.

However, to step back to my original post, I gather that stands as the basic way to move material from TBX to Scrivener unless one steps into the template creation business.

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



Posts: 133

Re: Tinderbox to Omnioutliner to Scrivener
Reply #5 - Jul 30th, 2011, 6:49pm
 
For the record, although I'm guessing you've already seen it, this thread over at the Scivener forums appears to have good information on getting data from Tinderbox to Scrivener:

http://www.literatureandlatte.com/forum/viewtopic.php?f=2&t=7244&hilit=Tinderbox...

As I said, if I figure anything else out, I can post here, and I'm sure there are others who know much more.

Also, if you go ahead and try the method Mark A describes (in aTbRef),  one the one hand it may simply work, and on the other hand, if you run into trouble, I'm guessing someone here could help with the details.
Back to top
 
 

WWW   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Tinderbox to Omnioutliner to Scrivener
Reply #6 - Jul 30th, 2011, 6:50pm
 
It's far harder to get the information you need than it is to spend an afternoon copying and pasting -- and that's the worst case scenario, if you absolutely don't want to take the trouble to learn a handful of export codes.

We've got some interesting Scrivener export features coming in the next few months.

But there are innumerable ways you might want to arrange a project in Tinderbox, and almost as many ways to arrange one in Scrivener. The more you do yourself -- either manually or using the power tools of Tinderbox export -- the more flexible you can be about arranging everything just the way you want it.

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



Posts: 66

Re: Tinderbox to Omnioutliner to Scrivener
Reply #7 - Jul 30th, 2011, 7:59pm
 
Lucas, thanks for the Scrivener link. You're right; I have read it.

It's one of the sources for my bit of kluge--TBX to Omnioutliner to Scrivener with some manual copy and paste of TBX contents into Scrivener. And is my plan for the moment.

I gather from this conversation so far that my little kluge is the best there is, short of pulling out the coding tools. I'll take a look but would much rather spend my time working on my content than writing code. At least at this stage of my life.

As for Mark, I understand your point and it's been a point you've made to me several times. Output from TBX is difficult--printing, exporting to other programs, etc., without learning your code. It's one of the things that accounts for my on-again off-again relationship with TBX.

But I'm still here. Because of the power of TBX and because, despite a bit of diffidence at times, you guys supply among the very best customer service in the business. And I appreciate that.

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



Posts: 133

Re: Tinderbox to Omnioutliner to Scrivener
Reply #8 - Jul 30th, 2011, 10:14pm
 
Hi John,

I did a little tweaking to Mark A's OPML code, and I've got it working now. So, here are the basic instructions:

1. In your TBX file, create a top-level note with the title "TEMPLATES"

2. Create two children of "TEMPLATES" with the following names: "OPML-wrapper" and "OPML-item". Make both of these notes into templates by opening the rename window of each and clicking the checkbox "Template".

3. Open the text window of "OPML-wrapper" and add the following Code:
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>OPML-wrapper </title>
<expansionState></expansionState>
</head>
<body>
^children(/TEMPLATES/OPML-item)^
</body>
</opml> 


(This part is unchanged from Mark's original.)

4. Open the text window of "OPML-item" and add the following Code:
^if(ChildCount)^^indent("\t",2)^<outline ^if(Text)^text="^value(attributeEncode($Name))^"_note="^value(attributeEncode($Text))^"^endIf^ ^if(!Text)^text="^value(attributeEncode($Name))^" _note="^value(attributeEncode($Text))^"^endIf^^if($Checked)_status="^value(attributeEncode($Checked))^"^endIf^>
^children(/TEMPLATES/OPML-item)^^indent("\t",2)^ </outline>
^else^<outline ^if(Text)^text="^value(attributeEncode($Name))^"_note="^value(attributeEncode($Text))^"^else^text="^value(attributeEncode($Name))^"^endIf^^if($Checked)^ _status="^value(attributeEncode($Checked))^"^endIf^/>
^endIf^ 



5. Open the document preferences (command-8), click on the "Text Export" tab, and choose "/TEMPLATES/OPML-wrapper" as the default template.

6. In Outline View, create a single parent note for everything you want to export (so that for what you export there will only be one top-level note).



7. Click on this top-level container note, then click the File menu and select "Export as text".

(7b: In the "Export" window, there are four buttons on the top left. Make sure the one for "Selected notes" is selected.)

8. Click the Export button and save the file, manually adding ".opml" as a file extension.

9. You should now be able to open the resulting OPML file in OmniOutliner.

Note: I don't have an expert understanding of Tinderbox export codes or of OPML, but so far the above seems to be working here. Starting with Mark's "OPML-item" code, I added a missing slash near the end and also a clause for notes that don't contain text. It wasn't clear to me that I did this correctly, and I can't make any guarantees, but it seems to work.

I've also uploaded a sample TBX with the export templates installed:

http://www.mediafire.com/file/0vr6fzeeeoge4vu/OPML%20Export%20Template.tbx

You could always just copy everything you want to export and paste it into the sample TBX.

Hope that helps!

Lucas

(Later: If you try to export a very large volume of notes it may take a while.  So I suggest trying it first with a smaller group of notes to make sure you get the desired result. If it works, then you could try something larger.)
Back to top
 
« Last Edit: Jul 30th, 2011, 11:40pm by Lucas D »  

WWW   IP Logged
John Kendrick
Full Member
*
Offline



Posts: 66

Re: Tinderbox to Omnioutliner to Scrivener
Reply #9 - Jul 30th, 2011, 10:36pm
 
Lucas,

This all looks terrific. I'm going to take a careful look at all of it, hopefully, tomorrow. Thanks again for the terrific help.

I'll even try tweaking some code. That is the sort of thing I needed to get me started.

As I said, terrific support.

John Kendrick
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Tinderbox to Omnioutliner to Scrivener
Reply #10 - Jul 31st, 2011, 5:12am
 
Lucas' problem had me scratching my head but I've found the error in the source reference.  OPML 'outline' tags follow XML convention and are (sould be!) written in one of two ways:
    <outline></outline>
    <outline />


The first form is used to nest descendants' oultine tags. Items with no children use the second form. In the aTbRef code reference cited further above, the closing '/' in the second form of tag had somehow gone missing. It definitely was correct when originally tested and posted so I guess got broken in subsequent editing (liely when the support for checkbox data was added). Anyway, the original aTbRef is now corrected - i.e. meeting Lucas' correction. Whilst the hood was up I also updated the ^if()^ syntax to current standards whereby all short-form attribute queries use the $-prefix. Thus ^if(Text)^ becomes ^if($Text)^. Both forms currently work but eventually the non prefixed version won't when legacy code support is dropped.

For John, the result of the last paragraph's change is here, "OPML-Item":

Code:
^if($ChildCount)^^indent("\t",2)^<outline ^if($Text)^text="^value(attributeEncode($Name))^"_note="^value(attributeEncode($Text))^"text="^value(attributeEncode($Name))^"^endIf^^if($Checked)_status="^value(attributeEncode($Checked))^"^endIf^>
^children(/TEMPLATES/OPML-item)^^indent("\t",2)^ </outline>
^else^<outline ^if($Text)^text="^value(attributeEncode($Name))^"_note="^value(attributeEncode($Text))^"^else^text="^value(attributeEncode($Name))^"^endIf^^if($Checked)^ _status="^value(attributeEncode($Checked))^"^endIf^ />
^endIf^ 



I've also updated my starter.tbx doc to reflect this fix (right-click link and 'save as').

@Lucas - thanks for flagging up the error in the reference.
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 #11 - Jul 31st, 2011, 6:30am
 
Thanks, Mark. I'll try to find the time later today (Sunday) to work on this.

John
Back to top
 
 
  IP Logged
Jean Goodwin
Full Member
*
Offline



Posts: 136
North Carolina
Re: Tinderbox to Omnioutliner to Scrivener
Reply #12 - Jul 31st, 2011, 9:00am
 
Hi, Mark:  You may want to check--your file doesn't seem to quite work.  It leaves "parent" items nameless.  Lucas' works, though, at least for what I've thrown at it.  Thanks!

This sort of thing is why I've never invested the time to go beyond very basic export.  It's not that export is hard--it's that it's fussy. That's why it's great when people donate their time and share their work product!
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Tinderbox to Omnioutliner to Scrivener
Reply #13 - Jul 31st, 2011, 11:54am
 
Hmm. That's odd. @Lucas' code doesn't make sense, insofar as it adds a cluase that says "if there is no $Text set the value of OPML attribute '_note' to value of $Text.  So I don't think that the issue.  it may be a whitespace thing.

Try this 'OPML-item' code:
Code:
^indent("\t",$OutlineDepth(parent)-1)^^if($ChildCount)^<outline^if($Text)^ text="^value(attributeEncode($Name))^" _note="^value(attributeEncode($Text))^"^else^ text="^value(attributeEncode($Name))^"^endIf^^if($Checked)^ _status="^value(attributeEncode($Checked))^"^endIf^>
^children("OPML-item")^^indent("\t",$OutlineDepth(parent)-1)^</outline>
^else^<outline^if($Text)^ text="^value(attributeEncode($Name))^" _note="^value(attributeEncode($Text))^"^else^ text="^value(attributeEncode($Name))^"^endIf^^if($Checked)^ _status="^value(attributeEncode($Checked))^"^endIf^ />
^endIf^ 

Back to top
 
« Last Edit: Jul 31st, 2011, 5:42pm 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 #14 - Jul 31st, 2011, 12:08pm
 
Six cheers for Lucas, whether his code makes sense or not. It definitely worked. Though it took me a bit to fill in the blanks.

I needed this kind of very explicit, kindergarten level hand holding to make it work: click on this button, paste this code, check this box, etc. However, I forgot that any templates note had to be checked as such. Spent some time trying to correct my errors at that stage. But the proverbial light finally went off in my head.

Once Mark Anderson gets his code cleared up, I'll try it as well. But, at least for the moment, Lucas' work "works" perfectly.

I gather the coding is elegant but the process definitely is not. It would be much better to have this built in to the process. At least for non coders. Coders could always modify the code to fit their circumstances.

Why not have this opml code or some other as one of the built in text options?

Thanks again, everyone, particularly Lucas. I would say your code made it possible but, actually, more than the code, it was the kindergarten instruction set.

John Kendrick
Back to top
 
 
  IP Logged
Pages: 1 2 
Send Topic Print