fsnotes icon indicating copy to clipboard operation
fsnotes copied to clipboard

Dragging images from the Finder changes their order

Open tewe opened this issue 4 years ago • 3 comments

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

  1. Set a Finder window to List view
  2. Sort the list by something non-alphabetical, like size
  3. Select multiple images
  4. 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.

tewe avatar Dec 05 '21 14:12 tewe

Trying reproduce, but in my case insertion doing like in TextEdit in all cases (include sorting by size)

glushchenko avatar Apr 22 '22 18:04 glushchenko

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.

tewe avatar Apr 22 '22 21:04 tewe

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.

tewe avatar Sep 23 '22 21:09 tewe