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
Exporting Notes Individually (Read 14261 times)
AGHorne
Full Member
*
Offline



Posts: 116

Exporting Notes Individually
May 24th, 2011, 6:17am
 
I'm trying to export some notes I've made in a container called "Notes"

Ideally, I'm trying to export as plain text, but I can export as html, if needed. I've got my export code correct, but I would like each note to be an individual text file.  How do I do this?
Back to top
 
« Last Edit: May 24th, 2011, 6:17am by AGHorne »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Exporting Notes Individually
Reply #1 - May 24th, 2011, 7:32am
 
To export a note as plain text, the contents of the export template is ^text(plain)^ - whether you use Text or HTML export.

File -> 'Export as text' exports one file containing one or more note's content as aggregated via Nakakoji view. By default the file is exported as 'exported file' (no extension). The default output silently overwrites the default output but if you specify a filename it will warn of overwrites. So you could select each note in turn, open Nakakoji view, select the built-in 'text' template and use the export button.

File -> 'Export as HTML' exports the whole doc to HTML, which isn't what you want. There are way to set up the whole doc so bits don't export.  For any note you don't want to export set $HTMLDontExport to true (or un-tick 'Export' on HTML view). For any container for whom you want to suppress all output, set $HTMLExportChildren to false (or un-tick 'Export children' in HTML view). For a few notes, it's simplest to export each via HTML view.

To do the latter, select the note, open HTML view and select the built-in 'plain-text'  template.  If you don't want the default HTML export filename type a name in the 'File name:' box.  Change the 'File Extension:' to '.txt' (include the period!). Then click 'Export'. The first time you do that for a doc you'll be asked for the export location, thereafter the the doc's last used location is remembered. The exported note will be in the export folder is root level. You notes will export into a folder called "Notes" in the export root folder as HTML export reflects the doc hierarchy.

Back to top
 
 

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



Posts: 116

Re: Exporting Notes Individually
Reply #2 - May 24th, 2011, 9:06am
 
I think I might have used a poor choice of words.

I want to export each note as it's own text file.  

Ideally, I want to select the container "Notes" and export the folder's children as individual text documents.  I currently have 123 Children in "Notes", so I'd like to export the container and have 123 notes, with the title of the note as the title of the text documents.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Exporting Notes Individually
Reply #3 - May 24th, 2011, 9:28am
 
OK then, as described, export the whole file to HTML. Either configure the doc to not export what you don't need, or export all and ditch the exported files. TB's HTML export is designed to export everything (set to export). There is no feature to just export a subsection, e.g. one branch of an outline - at least none I've come across.

A workaround if the above is all too difficult. Open a new TBX, drag all 123 files across to it (i.e. copying them), then setup HTML export (if not already done in the source TBX) export the new file to HTML, throw away the extra TBX when done.
Back to top
 
« Last Edit: May 24th, 2011, 9:28am by Mark Anderson »  

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



Posts: 116

Re: Exporting Notes Individually
Reply #4 - May 24th, 2011, 10:58am
 
The whole problem with HTML export is the filenames with no spaces.  I'm importing these documents back into Scrivener and would like the title of my documents to match $Name used in Tinderbox.

In Tinderbox my note "This is my note about whatever I'm thinking at the moment" is exported as "ThisismynoteaboutwhateverI'mthinkingatthemoment" and imported into Scrivener with that as the title of my note.... I would just like to have a smooth transition.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Exporting Notes Individually
Reply #5 - May 24th, 2011, 11:14am
 
Ah, well $HTMLExportFileNameSpacer - through an unenvisaged usage - might work.

[Later]Tested. Yay. Set the above attribute to " " (a single space). Easiest way is to set an agent to:

query:   inside("Notes")    or "/Notes" if Notes is root level
action:   $HTMLExportFileNameSpacer = " "

If you use odd characters - anything illegal in HTML filenames - in your notes' $Name these characters too will become spaces (see why). Still, I think that fixes your problem.

For once, an upside to an unintended (mis-)use of an attribute.
Back to top
 
 

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



Posts: 116

Re: Exporting Notes Individually
Reply #6 - May 24th, 2011, 9:17pm
 
One question...

I have some notes with longer names, so I set the attribute $HTMLFileNameMaxLenght to a value of 128.  However, now only 8 of about 30 notes export?  Why?

When I set it back to default 24, everything exports correctly.

Thanks again Mark.
Back to top
 
« Last Edit: May 24th, 2011, 11:52pm by AGHorne »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Exporting Notes Individually
Reply #7 - May 25th, 2011, 3:14am
 
The practical limit is explained on my article on $HTMLFileNameMaxLength, though it's not a page you'd otherwise rush to read!

It looks like TB still uses 'Classic' Mac max filename length limits. If you need longer, I'd mail in a feature request to move to OS X based limits.

For now, testing in v5.9.1, it looks like the maximum allowed filename length - with a '.txt' extension is 27, or 31 if you use no extension.

Don't forget, it's not all Tinderbox' fault, you could try addressing Scrivener's limitations at the other end.  I'm less well placed to comment on the latter as I don't have/use the app. It is worth bearing in mind, as often here we go through complex changes/workarounds just because of the limitations of other apps. Of course, other apps developers are less flexible, but that doesn't sound the case with Scrivener.

If your notes are using $Text, or its first paragraph as the $Name, consider moving the text back into $Text and using a shorter name. It might not be the process you originally intended but it might achieve the same end

Another approach, use TB Export as Text to export all the notes as one piece of text via a template that delimits each note's content with an easily searched for marker string, e.g. "##########". Then in Scrivener, after import use its equivalent of Explode (surely it has one?) to tease the single run of text back in to 123 notes.
Back to top
 
« Last Edit: May 25th, 2011, 3:30am by Mark Anderson »  

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



Posts: 27
Cambridge, UK
Re: Exporting Notes Individually
Reply #8 - May 25th, 2011, 4:44am
 
I may be wrong, but I don't think Scrivener will "Explode" a document like Tinderbox. But Nisus Writer Pro has a macro that will split a document into individual files. I'm not sure of the limitations of the demo version, but you might be able to use the demo (if you don't already own a copy) to split up the single document you've exported from Tinderbox and then import the resulting files into Scrivener. Or if you could turn the single document into OPML, I think Scrivener would import that, but you would need to check. I've hardly used the new version of Scrivener (yet). Using MultiMarkDown is another technique I used -- Scrivener imported a document I had in MMD and turned it into folders and files without much trouble.

Best of luck with it,
Martin.
Back to top
 
 
  IP Logged
Paul Walters
Full Member
*
Offline



Posts: 267

Re: Exporting Notes Individually
Reply #9 - May 25th, 2011, 4:59am
 
Scrivener has an "Import and Split" feature that will split a text file based on a user-defined token (default is "#", no quotes).  The note names are truncated, though longer than 32, I believe.   Scrivener also definitely imports OPML, which is what I use to get material from Tinderbox to Scrivener.
Back to top
 
 
  IP Logged
AGHorne
Full Member
*
Offline



Posts: 116

Re: Exporting Notes Individually
Reply #10 - May 25th, 2011, 5:19am
 
I was not at all blaming Tinderbox.

Simply looking for the "smoothest" transition over to Scrivener.  

Thanks for the help, everyone.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Exporting Notes Individually
Reply #11 - May 25th, 2011, 6:42am
 
By 'fault', I didn't mean 'blame'.  Smiley Rather, I was suggesting avoiding the trap to which we're all prone of continuing to push on the closed door in front of us just because it's we were doing when we became stuck. It's a trap I'll admit to falling into more often than I should.

As I'd hoped, some fellow Scrivener users seem to come up with some good alternatives. TB's OPML is pretty solid now after a series of improvements through v5. I've updated my notes on OPML import and export as well as giving code for two export templates (here and here) to use for OPML export.

I've also updated my old OPML-for-Scrivener.tbx demo. Despite the name of the file you can use it to export OPML for use with any app accepting valid OPML. I hope that helps...
Back to top
 
« Last Edit: May 25th, 2011, 7:30am by Mark Anderson »  

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



Posts: 116

Re: Exporting Notes Individually
Reply #12 - May 25th, 2011, 7:07am
 
It most certainly does help. Thanks Mark!
Back to top
 
 
  IP Logged
Derek Van Ittersum
Full Member
*
Offline



Posts: 168

Re: Exporting Notes Individually
Reply #13 - May 27th, 2011, 1:30pm
 
I'm brand new to scrivener (been playing with it for a few days, then pulled the trigger on the cross promotion Mark just sent out), but my initial thought was that SimpleNote would be the "smoothest" transition.  Any Scrivener users ran across problems or issues on that front that would make the OPML way more attractive?

One side note: is there a technical reason that led to the fact that aliases don't get synced by simplenote?  In thinking about Scrivener-TBX cross-pollination, I was imagining creating a boolean attribute (Scrivener) that I could use to "tag" notes that I wanted to send to Scrivener, then use an agent to put aliases in the Simplenote container.  Since aliases don't sync, this plan didn't work.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Exporting Notes Individually
Reply #14 - May 27th, 2011, 1:53pm
 
Simplenote has no concept of $Name vs. $Text which does mean some care is required setting up your notes.
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