Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Exporting from Tinderbox >> Drag drop note text and note attribute
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1305899995

Message started by Robert Matzken on May 20th, 2011, 9:59am

Title: Drag drop note text and note attribute
Post by Robert Matzken on May 20th, 2011, 9:59am

Although Export is the way to get a note's content together with that note's attributes into another software program, it is not always convenient, especially if it is just one note, or if notes need to be inserted into specific locations.

So is it possible to drag a note onto a Scrivener or DTP document, and thus not only transfer the note's content, but also the note's attributes?

Thanks.

Title: Re: Drag drop note text and note attribute
Post by Mark Bernstein on May 20th, 2011, 11:40am

Not in one drag. Remember: each notes has hundreds of attributes; you probably don't want them all.

Of course, you can copy selected values and paste those.

Title: Re: Drag drop note text and note attribute
Post by Mark Anderson on May 20th, 2011, 12:03pm

For simple text export, consider a template like:


Code:
^title^

MyAttribute1: ^value($MyAttribute1)^
...add more attribute refs as needed...

^text^

Too busy to try just now, but I suspect one might even be able to figure a way to make the attribute 'table' section of the template use $KeyAttributes or some other list's data to decide which attributes to 'print' saving you the extra time/effort on export.

Title: Re: Drag drop note text and note attribute
Post by Robert Matzken on May 20th, 2011, 12:26pm

Thanks, Mark A & B. Allow me to expand.

I make a containerNote and call it "Book 5". I set an attribute "BookendsRef". From the record in the Bookends Application, I then paste the Bookends Cite for this book into the attribute "BookendsRef."

Now, I read the book and make notes. These notes are stored inside the containerNote "Book 5". A prototype causes these notes to automatically inherit the attribute from its parent container with the Bookends Cite.

So what I do, is, I read, and press Return everytime I want to jot down a thought, or record a literal quote, and all those notes are automatically linked to Book 5, not only because they reside inside the container "Book 5", but also because they have the Bookends Cite in their attribute. Enabling me to move the note around, without worrying about losing the link to the source.

Now, there is one thing, which I am unable to achieve, but which seems to me that many writers and scholars might desire, which is the ability to drag-drop the note into a word processor WITHOUT LOSING the link to its source.

I understand that notes in TBX have many attributes. My request is not that they are all copied, my request would be to only include the attribute which is visible in the note.

I tried to copy the note's text and the note's attribute in one go, but I haven't managed. Command-A copies the note text, not the attribute values.

Mark A. I appreciate your suggestion, but it deals with export whereas I am specifically looking for drag-drop.

I have a wide screen. Tinderbox left, Mellel right. So I write, and whenever I want to include something from a note, I want to drag drop the note into the doc I'm writing, in the location where I need it. Exporting is not really an option.

What I would want is a modifyer key action. Drag drop is simply dragging the text of a note, like it is now. Shift-option drag to include the value of the visible attribute.

Title: Re: Drag drop note text and note attribute
Post by Mark Anderson on May 20th, 2011, 1:05pm

If I follow correctly, when you make an incidental note, prototypes already establish reference linkage. Why not make the prototype insert the reference's value as the initial paragraph in $Text. That way when you drop the text into Mellel, the reference is carried in the text. A workaround but it's do-able today (very busy no so no time to test the concept).

Title: Re: Drag drop note text and note attribute
Post by Robert Matzken on May 20th, 2011, 4:28pm

Mark, that's an interesting work-around!

As you know, citations always need to be inserted AFTER a quote. Do you think it would be possible to program the prototype so as to put a return in a new note first (a blank line) and then add the attribute value after that blank line? That way a new note would be more or less formatted when it's created.

There is another interesting angle to your approach. Rather than having just one attribute for each note, I could have many. So every new note displays various attributes, all inherited from the containerNote, such as Title of the Book, the Author, the Page number, the Reference Manager's Citation, but only the Attribute that is needed for inclusion after the text gets copied into the draft.

Title: Re: Drag drop note text and note attribute
Post by Mark Anderson on May 20th, 2011, 4:51pm

I think this is possible, using an (untested) a prototype rule. First, set the prototype's $RuleDisabled to true to ensure it doesn't run until applied to an actual note. Now the rule code:

$Text |= "\n\n"+"$CitationReference+"\nAnother attribute: "+$AnotherAttribute+"\nSome attribute: "+$SomeAttribute

The '|=' ensures the $Text is set once only.

Imprortant assumption: $CitationReference, $AnotherAttribute, etc., are all populated before the rule runs.

This sort of approach strikes me as better than hard-coding the drag.drop. Why? Not everyone uses TB the same way. What might - hard-coded- solve one person's workflow might destroy another's. Tinderbox users form a broad church.

Title: Re: Drag drop note text and note attribute
Post by Robert Matzken on May 20th, 2011, 5:52pm

Thanks Mark.

Rather than a Prototype Rule, I have opted for an onAdd instruction in the parent container. This removes the need for checking if the attributes are populated.

This container (e.g. "Book 5") has a number of attributes set, including Title, Author and BookendsRef. These attributes are all carried over to the notes created within the container, by the onAdd instruction.

I have now extended this onAdd to assign the value of $BookendsRef(parent) to $Text of the new note. Also, in the same instruction, I add curly braces and a hash to the value of BookendsRef, so these references are already formatted for a final Bookends scan.

Only the linefeed doesn't seem to work in this onAdd configuration. Other than that, this seems a satisfying set up. I will work on making some notes for a few books, and copy them into a text I'm working on, to see how this system 'works' in practise.

Thanks again, Mark A.

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.