Tinderbox Forum

Action to Create Alias with New Note

Is there a method using Actions that allows you to create an alias at the same time that a new note is created and then send the alias version to a different container?

Use Case

In building a story I want to create two versions

  • A number of story Arcs all displayed on a timeline so that every scene can be seen in chronological order
  • A manuscript version in which the the story jumps back and forth in time and jumps from Arc to Arc.

It appears to me that to accomplish this I need two versions of each scene and at least two methods of presentation

Any suggestions or guidance on methods to create the two versions of the scene would be much appreciated.

Thanks

I’m not aware of an existing action specifically for this. Checking the AppleScript dictionary I don’t think that offers an alias. But you could use:

  • use runCommand() to call an AppleScript to send the necessary UI or keyboard commands.
  • take the same AppleScript approach but invoking the code via an OS service, using Automator.
  • use a tool like Keyboard Maestro to send shortcut keys (⌘+L) to the app.

Are you assuming a single selected note or multiple notes. In the latter case would the ‘action’ be applied to each in turn?

I’d do this by placing the sequence number or calendar time in an attribute. Arrange the notes inside a container in manuscript order. Then, let an agent gather aliases of those notes, and sort the aliases in timeline order.

You could have a third agent that sorts first by Arc number, and then by timeline order within an Arc. That might be handy, too!

1 Like

Thanks Mark.

My intention was that when a new note was created an alias would be automatically created at the same time and sent off to another container.

However, your response got me thinking again and I realized that an agent will create an alternative set of notes (alias’s) and with careful use of attributes + Agents I should be able to create what I want.

Thanks Mark:

Good thought but unfortunately my workflow would be in the opposite direction. I want to build events in the timeline and then use the set of notes that were generated to build the manuscript.

However, I think the basis of your idea will accomplish what I need. My thought is:

  • Build a pool of notes
  • Create an agent to show the timeline
  • Assign notes to a TimelineBand
  • Assign dates to each note as appropriate
  • Create an agent/s for the manuscript
  • Use User attributes to assign chapters to the notes
  • Experiment with the order of the notes in each Chapter using a map view. The position of the note in the map view gives the ypos or xpos
  • In an outline view sort by ypos to get the manuscript notes in the correct order ( I cribbed this from another user whose name I forget so apologies to them for lack of credits).

I’m still experimenting with this so I don’t know if the workflow is flawed.

Even if this works I have to believe with the smarts in Tinderbox there ought to be an easier way.

I have posted yesterday my writing workflow for stories and screenplays.

Even though I only work in outline view it might work for your purpose.

To filter by different arcs and timelines I use different attributes.

$MyTimeSlot for time line view and $MySet for an ArcView. In my example $MyTimeSlot is just a string but could be a date as well.

In my current project I have 6 different views which are all populated by an attribute and filtered and sorted by agent.

To sort the notes in manuscript order $MyNumber works quite well.

If you want to use MapView and export it later in sequential order I remember a video from @satikusala where someone (a Filmmaker from Sao Paulo) proposed to use the x or y coordinates.

1 Like

OK, I think I have a way to do your think. Try this: Timeline-builder.tbx (108.1 KB)

Add new notes into ‘Event-stub’. An OnAdd sets the Event prototype (you can amend that to a prototype of your choice). The Timeline is an agent, query: $Prototype=="Event"

So adding a new note to the ‘Event-stub’ means it is aliased into the timeline. The Agent also has an action (linebreaks/spaces added for clarity here):

if(!$Placed & $StorySection){
   $Container(original) = "/Story/" + $StorySection;
   $Placed=true;
}

I’ve 2 user attributes: a String -type StorySection, and a Boolean Placed. The point of the latter is to make sure the agent action doesn’t keep re-moving the original to where it already is. But, what if I set StorySection incorrectly, or I wanted to move a note in the story? Correct the note’s $StorySection and un-tick $Placed. The agent action will now fire and move the original from where it was in the story/manuscript to new correct right place. IOW the Boolean acts as both a check for unnecessary code execution and as a reset mechanism.

In the query we test $Placed first as we are only interested in notes that have a place in the story but the original hasn’t yet been moved. Why? Consider the doc when we’ve 50 notes with a $StorySection value but 3 notes with that and where $Placed is false. If we test $StorySection first, we match 50, then 3 of 50. But if we reverse the order, we match 3 and then 3 again (53 tests vs 6 tests). In a small doc it matters little. But, you’re writing a story: there will be many events.

If you rename container ‘Story’ also edit the same in the agent action: see code shown above, as that name is hard-coded (you could parameterise)

I did try and use action code to use the children of \Story to set the suggested values of StorySection but no joy. Note: I’ve reported (via email) a bug with the operator (i.e. it reads but won’t write key values). Meh, that bit was only an ‘extra credit’ polish anyway.

To me, the upside here is the real ‘original’ notes live in the Story (i.e. narrative) part of the doc and we use aliases to move them around. This is the same as your idea but with originals and aliases transposed. Why/ when it comes to export, as I’m sure is a later stage to come, it is easier to work with the originals rather than the aliases (why? … because, experience!)

Anyway, give it a try. note that new events are in the left column when seen in the timeline view (try the other ta in the doc). You don’t need to set a date to move the note into the story. In the Timeline view try selecting “some event” in the left sidebar and setting a $StorySection value of “Chapter 3”. See—in outline view—the original move from “Event-stub” to “Chapter 3”.

Next select “another event” in the Timeline sidebar and give it a start date. See the alias move out of the sidebar into the timeline. (Re-)select the note and set $StorySection to “Chapter 4”. Again, see that the original is moved. Notice how the action adds a now child container “Chapter 4” to /Story. A nice neat affordance of setting the $Container path to a location not currently existing - the missing parts of the path are created for you.

1 Like

Thanks for your response.

I found your model very helpful.

I did have a question about your arc view. Do you intend to separate the scenes into Arcs? I want to make sure I understand how your design works. Looking at the arc view it seemed to be the same as the Scene View.

It is not done in my the example file. You could do it easily by adding a new attribute and filter the scenes accordingly.

In my current project I use an attribute ($Domain) do filter scenes by different perspectives (from which point of view a certain scene is seen and/ or experienced).

A scene in my design is the smallest unit which can be moved around in a manuscript. A scene has 1 location, 1 time slot, 1…n players and is seen from 1 player perspective aka Point of View.

I don’t know if this question should be a separate topic but still I’ll ask here since it relates to the code.

Question:

Referring to Timeline-Builder. I want to know if code like $Prototype=“Event” has to be Primed in order to function?

Details

I created a new Tinderbox document and set up the container for the notes along with the prototype. I added the code for allocating the prototype to the note.
Initially I could not get this function to work. I clicked on the tab to refresh. I closed and opened the document. I copied the original code from Timeline-Builder just in case.
But the function would not work.

Based past experience I manually allocated the prototype to a note.
Then created a new note and the function immediately worked.

Comments

I’ve noticed when in viewing an attribute in the selection field at the top of the text view and using the right hand arrow to select a value that the selection box remains empty until you manually add a value. Once the value is added it becomes available in the drop down list but not until its been “Primed” so to speak.
In the case cited here I would expect that once a note is designated as a Prototype it would appear in the drop down list but that appears to not be the case. As noted once the prototype was assigned manually everything worked as expected.

This might be an forum (re-formatting) issue but action code won’t read :slight_smile:

$Prototype=“Event”

as

$Prototype="Event"

In action code you must use straight single double quotes. To a computer " and are not the same thing.

Mark: Thank you for crafting this elegant solution. I was able to take your solution and expand it to give me exactly what I wanted.

Addition

In my final design I wanted to be able to drag events on a map to create the order of events that I wanted in a chapter.
So I created a map view of the timeline agent.
On the map I created adornments for each chapter. Added action code *$StorySection=Chapter 1" etc. Thus dragging events onto the adornment results in the assignment of the Chapter number and then your code moves the original to the appropriate chapter. In the outline view the children in the chapter are sorted according to their ypos. Thus each event appears in the order I want for the chapter.
I took a similar approach with assigning the TimelineBand for the time line display. However, to do this you have to create a second agent.
To make this work I have (so far) found that four views suffice:

  • Outline
  • Timeline
  • Map to assign chapters
  • Map to assign timeline bands

This workflow is less textual and more visual (hopefully that makes sense), which is more to my preferred approach.

2 Likes

Great. Glad that’s helped. :slight_smile: