Tinderbox Forum

Retaining map layout when moving items to new map

Say I have a group of notes. I drag them into a container, and open a Map view of the container.

By default, Tinderbox will display them as a long line of boxes. This is not an unreasonable choice, but if there are a lot of them the line will run off the edge of the screen, and I’ll need to do some rearranging before I can even see all of them at once. (At a reasonable size. I know I can zoom out as far as I need, but that makes the note titles too small to read.)

Is there a way to either change this default or constrain placement so that all of the notes fit within a given area?

View | Arrange | Cleanup…


View | Arrange | Dance


If you drag notes into a container (i.e. make them children in an outline sense) _when in map view), they should maintain their layout. Still that can be fiddly, but the same topic came up the other day. As the solution came at the end of a thread, I’ll repeat it here.

Let’s say that in the following map we want to move the two notes and the adornment into note ‘Storage’, making it a container.

The idea, i.e. what is going to happen:

  • We will use the stamp to do the moving.
  • In the stamp code, before we move the notes we will record their {x,y} postions from $Xpos and $Ypos and store them in two user attributes, that we will need to make beforehand.
  • The stamp, when applied will:
    • record the positions of all selected items on the map,
    • move them to a new map (by setting their $Container attribute)
    • re-set the old {x,y} positions as on the original map, avoiding the line of icons you describe in you opening post.
    • Lastly we will delete the stored ‘old’ positions. There is no point keeping that data, especially if it will not be used again.

Now, to set up for the process:

  1. Make two new User attributes. Call them MyXpos and MyYpos and ensure they are of the ‘number’ data-type (it’s a pop-up setting on the User attribute Inspector).

  2. Open the Stamp Inspector. click the ‘+’ button to make a new stamp and replace the default stamp name with ‘Map mover’.

  3. Add the stamp code. With your new stamp still selected (step above), in the bottom box of the inspector labelled ‘action’ put the following code:

$MyXpos = $Xpos;
$MyYpos = $Ypos;
$Container = "Storage";
$Xpos = $MyXpos;
$Ypos = $MyYpos;
$MyXpos =;
$MyYpos =;
  • The top two lines store the original map {x,y}. Line 3 moves the selected items. Lines 4–5 reset the moved items to their old co-ordinates. Lines 6–7 delete the now un-needed extra data.
  • This code is for the demo. For your use, you would replace Container with the $Name of your target container. If that $Name is not a unique value, use the whole $Path unquoted. IOW, either $Container = "Storage"; or $Container = /Storage;. (Sorry if that latter nuance seems confusing - I don’t make the syntax rules!)

Now to use the stamp:

  1. If this is your first time of use, save your file so you’ve the confidence to roll back if you make some unexpected mistake. At this point it’s as much peace of mind as necessity. With your own real work it definitely is peace of mind until you know the process works.

  2. Select all the items to move. Hold the Option key and drag a box around the desired items, or Cmd+click items to add them to the selection. NOTE: make sure the new container is not part of the selection!

  3. Open the app’s Stamps menu, and click on ‘Map mover.’ This applies the stamp we just made.

  4. The selected items will disappear from the map. Select the item intended as the new container, and press the down arrow ↓ to move into that map. You should see you old map items, now moved (you might have to scroll a bit to see them). Job done!

Some last thoughts:

  • You can use this method to move map items to any new location. For this demo we are using a note on the current map as the new container, but that’s for simplicity. The notes move to be children of whatever note you specify in line 3 of the stamp’s code.
  • If you are moving items to a map with existing items, you may get some over lap of items. This is unavoidable, so I would suggest setting the target map container’s $NeverComposite to true to suppress accidental composite formation. If you do use composites, after you’ve un-overlapped any new/old items you can reset $NeverComposite to give you normal composite behaviour.
  • If you only do this process once you can safely delete the stamp and the 2 user attributes once you are happy with the outcome.

Lastly, a very simple demo file to let you try the above: Map-move-demo.tbx (86.0 KB)

View ▸ Arrange ▸ Cleanup gives you lots of options and takes almost no time.

Yup…Select the View menu, Arrange, and then the Cleanup option.


It will then organize these notes in a grid, row, column, or box.

If you have the notes tagged with a particular attribute you can also use smart adornments to automatically pull them into the right place.

That’s not what I’m trying to do. (Someone appears to have edited the thread title in a misleading way.) I’m trying to change the default layout when a brand new Map view is opened for the very first time. The specific case is after creating a container in Outline view, but the same applies to the top level map.

View -> Arrange seems to do the trick. Thanks to @latinhypercube for pointing it out.

One detail that might confuse some people: the layout of notes does not actually inhere in a map view; it’s in the notes themselves. So, if notes are arranged one way in this map view, they will be arranged the same way in another, new map view of this section of the document.

Lest you wonder, I altered the topic so it better reflected what this actually says; had it made clear the issue was going from one view to another—there being a difference—the confusion might have been less. I don’t mean that unkindly, i’m just explaining why I made the change.

So, Yes, if you want an auto-layout of the items then the Arrange and (if notes are linked) Dance methods should help.

We need to remember the app doesn’t ‘see’ a map (in the we we humans do) even if the current view is a map, so it needs a simple method to to add items safely to a container (in a different view type). So, if you are in, say, a chart and move a selection into a new container, Tinderbox’s is mainly trying to avoid adding an item so it doesn’t overlap or composite with existing items.

There is, at least as at v8.9.0, no mechanism for changing the ‘default’ map layout of selections dragged in a container when not in map view.

I think the original title accurately reflected what I wanted to do. That’s why I chose that title.

When one is unfamiliar with Tinderbox, it is very easy to misuse Tinderbox-specific terminology.