Jump to content
FroZen_X

Multiple paste of Files from Clipboard history

Recommended Posts

Hello everyone,

 

it would be pretty cool if it would be possible to select multiple Files, Clips or whatever from the Clipboard history and paste it.

For instance:

 

I would have copied a few files and wanna paste them. Here is an example:

58a1e04395623_ScreenShot2017-02-13at17_34_55.thumb.png.05f92decdf1218547a3b264ce28f630b.png

 

If i could now just press Shift+Arrow down to select multiple items and then just paste them that would be awesome :D

If there is another way then lemme know, but else this would be decent to have.

 

Another addition to that would be the ability to change the Shortcut for adding files to the file buffer. Something like

⌘+C and ⌘+V would make the file Buffer/Navigation even better :)

 

Cheers,

 

Frozen

Share this post


Link to post
Share on other sites
On 6/29/2017 at 4:39 PM, deanishe said:

Düsseldorf? Surely you mean trash multiple files at once?

 

haha, that are documentation pictures from work whenever im there ^^

Share this post


Link to post
Share on other sites

I did some investigation into this, and in theory it's possible to do..

 

Clipboard items are stored in an SQLite database here: 

~/Library/Application Support/Alfred 3/Databases/clipboard.alfdb

If an entry is an image, it's file type is indicated via `dataType` column, and the file name is saved to a column named `dataHash`.

 

The files themselves are saved to the following directory:

~/Library/Application Support/Alfred 3/Databases/clipboard.alfdb.data

In theory, it'd be possible to do it this way:

 

- Gather `{n}` items from clipboard.alfdb via a simple database query

- Iterate through items and append each to an in memory text object

- Any items that have a `dataType` of `1` should be located in the `clipboard.alfdb.data` directory and probably need to be converted to blobs with:

base64 -in "~/Library/Application\ Support/Alfred 3/Databases/clipboard.alfdb.data/$ITEM_DATAHASH"

- Append blob to in memory text object 

- Copy in memory text object to clipboard no more items to iterate over


It's probably a bit more tricky than this, I don't know if you can just copy a blob and some plaintext to the clipboard and paste it as file plus the plaintext, because the blob is plaintext. 

Share this post


Link to post
Share on other sites
3 minutes ago, bnwd said:

It's probably a bit more tricky than this, I don't know if you can just copy a blob and some plaintext to the clipboard and paste it as file plus the plaintext, because the blob is plaintext. 

 

You can't. Clipboard data is typed (with UTIs). While you can theoretically just smash a blob of text+binary data in there, it isn't going to paste well.

 

You'd probably need to save the text items to discrete files, then put a sequence of filepaths on the clipboard.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...