Dragging images from the Finder changes their order
Description
Selections in the Finder have an order. If you drag a bunch of images into a note, they don't arrive in that order, but sorted.
(Finder isn't very consistent in how the order comes about. In icon view, it's the order you touch items with the lasso. In list view, it's however you sorted the list, not your drag or ⌘+click order.)
To Reproduce
- Set a Finder window to List view
- Sort the list by something non-alphabetical, like size
- Select multiple images
- Drag and drop into the FSNotes editor
The Markdown links will be created in alphabetical order.
Expected behavior
The order is kept, like it is when you drag into TextEdit in Plain Text mode.
FSNotes version
5.1.3
macOS/iOS version
macOS 10.14.6
Additional context
This is probably due to using board.readObjects(forClasses: [NSURL.self]) instead of board.data(forType: NSFilenamesPboardType), which seems not available in Swift.
Trying reproduce, but in my case insertion doing like in TextEdit in all cases (include sorting by size)
On macOS 12.3.1 I can no longer reproduce this.
However, when I drag a selection, without changing it, first to TextEdit and then also to FSNotes, I get opposite orders. Since the cursor also ends up after the first item, I assume FSNotes prepends where it should append.
https://christiantietze.de/posts/2022/09/nstextview-plain-text-pasteboard-string-not-included/ seems to show a way to get old PboardType constants into Swift.