Dragging files and folders in from Finder

Hello everyone! I hope this Tinderbox Forum “Q & A”-thread question post finds you well. (Just kidding! I’m making fun of people who correspond using ChatGPT. May GPT be the straw that launches our Butlerian Jihad.)

I have a question regarding dragging Folders from Finder into Tinderbox.

My goal is to import and (importantly) reproduce the outline order of groups and text-like records from DEVONthink. I’m mediating this through Finder, doing an Export > Files and Folders … to Finder first, and then dragging this into Tinderbox.

So I’d like the outline order inside TB to match some kind of sorting order. Once I know what TB is using to determine the post-drag outline order, I’ll find a way to preserve it.

But I’ve noticed that when I drag files and folders from Finder into a TB window (in Outline View, not that it matters), the resulting outline order seems indiscernible. I’ve tried various in-Finder sortings but none match their post-drag ordering inside TB.

So my question is: How does TB determine the order of dragged-in-from-Finder elements?

Thanks!

I don’t know — and I wrote it!

I believe Tinderbox imports Finder drags in the sequence they’re added to as NSPasteboardItem*s. And I believe that sequence is undocumented.

What sequence would you like? I’d be inclined to sort them in Tinderbox in the way you want — perhaps alphabetically, or by date?

Hello! Thanks so much Mark; that would be great.

Well, I think Name (alphabetically) would be most useful. I imagine a lot of people use numbering to preserve ordering when passing lists between applications. Actually, I have AppleScript scripts for both Finder and DEVONthink that prepend and remove numbers just for this purpose.

Thanks again!

1 Like

FWIW, once data is in Tinderbox the following may be useful place to check the affordances of sorting in Tinderbox: see the Sort Inspector and linked articles.

Nothing could be simpler than sorting the imported notes alphabetically; just set the container’s Sort criteria in the inspector.

Select the container holding the to-be-sorted notes:

Note the sort is a lexical sort (based on computer encoding character number), so 0-9 sorts before a-Z, within which a sorts before A which sorts before b, etc.

Ha ha (embarassed sweat emoji :sweat_smile:).

No sooner had I sent it in my manic and sleep deprived state (similar to now) than I realized that my script comment made the very request unnecessary.

Of course, it would be nice to have a pre-known sort, but … yes, I answered my own question. Thanks, Marks!

One other point to note re sorting—in long-term docs. Sorting runs essentially all the time (not quite as aggressively as rules) so things are sorted as expected. But, for ingested notes, once sorted, if the titles don’t change you can probably turn sorting off (set Sort Inspector to don't sort or set $Sort to ""). Essentially, your’e turning a light off in a room your not using. In small docs its no gain. But in a large long-term doc it avoids using effort more usefully expended elsewhere.

Something action code (rules, stamps, etc.) can’t do is say “sort this then turn off sorting”. You need two discrete actions—not two discrete action expressions within the same action—once to turn sorting ‘on’ and a second to turn it ‘off’. No big deal, but trying to use one action for this is a mistake easily made.

Sensible advice, but Tinderbox is fairly smart about no re-sorting things when they don’t need to be sorted.

Sorting is most challenging when you have containers that hold more than 1000 notes. Even then, you can usually manage fine, with perhaps a couple of seconds extra delay when reopening the document.

I’d suggest not worrying about the time that sorting takes unless you actually find a particular document is slow.

2 Likes

Hello! I just discovered this related behavior: When copying a list of groups and other records in DEVONthink and then pasting into Tinderbox (into an unsorted container), the order is always the reverse of the original order they had in DEVONthink.

1 Like

If you sort by Unsorted the records are sorted by the Addition Date:

The Unsorted order is the order in which the items were added to/created in their enclosing group.

Post from cgrunenberg at the DEVONthink forum

That’s the sort order we get via AppleScript.