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
Send Topic Print
noob has the urge to export ... (Read 4672 times)
Sam Dave
Full Member
*
Offline



Posts: 17
Exeter, UK
noob has the urge to export ...
Jun 17th, 2011, 4:36pm
 
I've been playing around with Tinderbox for about a week and been really pleased with the progress I've made so far (thanks in large part to the help I've received on the Forums).

I'd like to make a start learning about exporting but try as I might - reading various documentation sources and others' questions on the Forums - I'm somewhat confused.

Let's start really simple (he said, hopefully). I have a note which has processed some data for me. The results of that processing are now stored in an attribute in that note. (It's a list attribute called $phraseString).

I'd like to export the value of that attribute to a text file. I don't need it in HTML, just good ol' plain text (it's heading for a word processor. When I'm more experienced in Tinderbox I'll probably leave it where it is, and do more work on it there, but for the moment this seems like a good opportunity to start learning about export).

I don't want to export anything else (from that note, or any other). Just the value of that single note's single attribute.

OK, so based on what I think I've read, I'll need a thing called a 'template' and that will include the code ^value($phraseString)^

But I don't know if I need anything else, I'm not sure where to put that template, and I'm not sure how to proceed. (I assume that when I go to FILE>>>EXPORT AS TEXT, I get the chance to select my template?)

If anyone could help me out, I'd be very grateful.

Thank You.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: noob has the urge to export ...
Reply #1 - Jun 17th, 2011, 5:14pm
 
To export an attribute, ^value($MyAttribute)^ in your template is the route to go, but be aware of formatting issues. Re $phraseString, note this on attribute naming best practice.

To make a note into a template, see about $IsTemplate and more here.
Back to top
 
 

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



Posts: 17
Exeter, UK
Re: noob has the urge to export ...
Reply #2 - Jun 18th, 2011, 4:07am
 
Superb.

Thanks, Mark. I especially appreciate you taking the trouble to answer that one at 22:14 on a Friday.

I now have a text file containing my attribute (a list of phrases separated by semi-colons.) I'm sure there's more I could learn about inserting line breaks within Tinderbox but for now I can do all that in a word processor easily enough.

Now that you've given me the basic mechanics of creating/using a text export template, my next step is to play around with extracting other stuff in text format.

Your point about attribute naming is useful, too. Definitely a hangover from my other coding efforts where I'd capitalise class names and use lower camel case for properties. Funny - even as I was naming attributes in that way in Tinderbox some part of me was thinking, Mmm, I'm not sure they do it that way round here.

Thanks again.
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: noob has the urge to export ...
Reply #3 - Jun 18th, 2011, 7:33am
 
Sounds like you're exporting a List or set type of attribute.  Look at the .format() function for those data types. You can either concatenate or provide list & litem prefix/suffix formatting.
Back to top
 
 

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



Posts: 17
Exeter, UK
Re: noob has the urge to export ...
Reply #4 - Jun 18th, 2011, 8:37am
 
Now you're just spoiling me.  Smiley

You're right - I'm exporting a list.

Code:
^value($phraseCollection.format("\n"))^ 



worked perfectly.

Thank You.
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print