Thread: Export problems
View Single Post
Old 06-24-2021, 11:56 AM
Spliff Spliff is online now
Registered User
Join Date: 04-07-2021
Posts: 72
Export problems

In another thread, I had said:

"In fact, UR's XML output - its RTF output seems, unfortunately, be limited to just ONE item every time (?) - seems very powerful, but from my (intermediate) findings, there is NO way to get FORMATTED XML output just into ONE file, so any XML export-to-file will need quite heavy scripting in order to then combine the UR-produced multiple XML files (which seems to be perfectly possible, it's just that up to now - using UR about 3 months now -, I haven't had the courage and the necessity to look further into this problem)?"

kinook had answered:

"You can export multiple rich text items by multi-selecting the items.
You can export XML -> HTML multiple items into a single file. Multi-select, or check the 'Export child items (recursive)' option and select an HTML conversion option."

So we have got two problems here:

RTF export: You're right, multiple selection will do it! (I had, in vain, assumed that parent item plus its child items would be processed, but multiple selection will provide much more precise selecting, so in some cases, it's a little bit cumbersome, but overall, it's the better solution indeed (in the absence of more fine-tuned options being available).)

XML export: No way to get it into just ONE export file, it always creates a folder, even when, as target, I mention a file. (I have tried again today, but had tried for hours some weeks before, and after reading and re-reading the help file.)

Let's say I have item A with 5 child items aa, ab... ae (= 6 items in total). File - Export - "Documents and item rich text to HTML" ("Use saved settings: Default") - Next:

"Then I get FOLDER to export selected items to": "d:\downloads\try.xml" (i.e. a file name) - "Export child items (recursive)" = checked, and "Save settings as: Default"; "Finish" >

I get the folder (!) "try.xml", in which the folders "Export_Icons", "Export_StoredContent" (in there: 6 folders named after the respective IDs, here 41523...51528, and each folder with a file named "RespectiveTitelOfItem.html") and the files index.html and toc.html.

Now "File - Export - Items to an XML (OPML) file" > "Export - Select Attributes": "Item Details (RTF") (I never found "Item TITLE" in that list!) > Next >

"File to export..." "d:\downloads\trynone.xml" ("Export child items (recursive)" checked) "HTML: None"
> I get trynone.xml which is a container / reference file for the folder "trynone_StoredContent", and then as above

Ditto but "HTML: Dynamic Outline" (into d:\downloads\trydynamic.xml")
> I get the file Export.html which is a container / reference file for the folder trydynamic_StoredContent

Ditto, but "HTML: HTML" (into d:\downloads\tryhtml.xml)
> I get the folder tryhtml_StoredContent, and as above again.

Thus, I am not able currently to get a set of UR items (here: 1 parent with its 5 child items) into ONE XML (!) file, and probably the OPML format is natively an XML format which creates multiple folders, multiple files, as an exchange format with other outliners.

What I'm after though, is export into ONE XML file, like the XML files read into, or written by, e.g. screenplay applications, like Final Draft, Fade In, etc.

By external scripting, it would certainly be possible to get all that XML data spread over multiple folders and multiple files into just one XML file (which then might be necessary to be further adjusted, externally, in order to make it 100 p.c. compatible with the expected target XML format), but I had hoped UR had such an export format "many items to one xml file", as it has got for the .rtf format indeed, as you very kindly explained to me?

EDIT: So I'm speaking of strictly FLAT export, not any hierarchical one, just the title of item 1, formatted content of item 1, title of item 2, content of item 2, and so on, in tree order, and with no regards to possible indentation of the items within the tree. (And some "new page" indicator between the pages but which should not need to be explicit, since after all the title lines' (but as said, the title attribute is missing from the above set of attributes to include) XML formatting should be sufficient as "new page" indicator.)

EDIT 2: I forgot to mention the "Static Outline" alternative above, but in my tries, any content formatting with it is lost then, so that would not do it for me.

EDIT 3: It should also be noted that any script which tries to gather the different contents from the different folders and files, into one file, would need to check the "container / reference" file, for the ORDER in which the multiple xml files are to be processed then, since it's obvious those folders can not be processed in numeric order, since numeric order is, grosso modo, determined by the respective creation dates of the multiple items, not by their tree order. Thus, the script would have to look up every line in the reference file, get the corresponding ID number, then get the data out of the specific folder. It's evident that NOT creating all those numerically-named folders to begin with would greatly ease export into one target file, but perhaps it's possible (and with preserving content formatting) after all?

Last edited by Spliff; 06-24-2021 at 01:00 PM.
Reply With Quote