Order of notes in outline view

Is there an attribute to reorder the notes in outline view - without using sort. I would like to create a note the appears in 1st place of my outline view.

Canā€™t you just manually drag it there? Otherwise Iā€™m afraid I donā€™t understand the question.
In the Finder I solve that problem by starting the name with a space (ā€ž Noteā€œ) and then sort on it.

I just create a new Attribute and populate it with numbers or letters that I can sort by.

I would like to place it via ActionCodeā€¦ there has to be an internal attribute to make this happenā€¦

I concur. Either sort or manually drag - those are the options. $SiblingOrder and $OutlineOrder are read-only so you canā€™t write a code like:

if (condition is met) { make me first sibling in my container)

Iā€™d agree using $Sort can be troublesome, as once set it runs continuously until reset. Iā€™ve a long-standing feature request to be able to do a ā€˜one-timeā€™ sort on a container. IOW, sort it on a given criteria and once items are sorted revert to no applied sort.

Why? If you try to do this via action code, in a single action, it fails as Tinderbox canā€™t be told to wait until the sort is complete before negating the $Sort setting:

// This does *not* work as intended , used on the parent container
// sort children using $MyNumber
$Sort = $MyNumber;
// sort done, now reset to normal;
$Sort =;
// failure as latter fires before *effect* of first is complete
// action code has no 'wait' mechanism
// events like completion of a single sort - timing dependent on the rule cycle - aren't exposed

You could use a discrete action (stamp?) for each step but then the user has to wait and judge when the sort has run at least once before applying the second action. So, not very automated. :slight_smile:

Based on what criteria, i.e. what data value?

simply I would add a note with create and make sure that it will become the first note in the outline view (Iā€™m creating my default setup for a new file with action code).

P.S.: and what a funny country with a ā€œnobody told me that it is illegalā€ leader you have. Here in Germany we take everything so serious - party poopers we are :slight_smile:

Best summed up by one headline ā€œNo one told me it was illegal says man who sets rulesā€. It would be funnier if it were someone in a less important role. Instead, regardless of party affiliation, it is not the nationā€™s finest hour.

3 Likes

Ah, you want the equivalent for create() of Shift+Return vs Shift+Option+Return when manually adding new notes.

I think that is essentially a feature request for something like create(item [, blnFirst]). Thus we retain the status quo (child is added as last sibling):

create("taps");  // adds new last child to current container

and new:

create("taps",true);  // adds new first child to current container

pinging @eastgate

1 Like

Sorry I donā€™t possess the coding skills to present this suggestion correctly - but to my mind, it could be done via:

  • Create User Attribute $Sorter
  • Create Container One
  • Set $Sort status of Container One
  • Create Note A within Container One
  • Set $Sorter value of Note A to ā€œ1ā€
  • Create subsequent Notes as needed, and
  • For every new Note, assign an incremented/decremented value of $Sorter

You could also programmatically assign values <1, in effect ā€œpinningā€ said Note/s at the top of the list.

Seems like this could be done in action code, am I wrong?

1 Like

Thanks, though this breaks the OPā€™s request to avoid using sort :slight_smile: , I still think @archurhhā€™s solution above could be made to work. However, youā€™d first need to check if any existing children had a $Sorter value of 1. If so, that would need to be deleted before adding the new note or youā€™ve two notes with a $Sorter value of 1 which may result in a wrong sort order.

Something like this stamp (tested in v9.1.0):

// Requires user attribute 'Sorter', number-type.
// Container's $Sort should be set to "Sorter' and sort in reverse order,
//    $SortReverse set to true, so that 1 sorts before the 0 in all the other notes

// Zero out any existing Sorter value(s)
$Sorter(children)=;
// Now make new note
var vNote = "/path/to/note/or/name/of/note";
var vPath = create(vNote);
// vPath now holds the confirmed $Path for the newly created note
$Sorter(vPath) = 1;

This works, although the create() call doesnā€™t refresh sort (I was using Outline view in my test FWIW). So, you either have to wait for the next update cycle or flush via the File ā–ø Update Agents Now ā€¦ which of course you canā€™t do via action code! Butā€¦

ā€¦ the real fix isnā€™t this forced sorting but rather having the (presently missing) ability to make a new action-code-created note be placed as first child rather than last child as is the current and only behaviour. A feature enhancement to that end has already been suggested in my previous post above.

HTH

1 Like