Synthetic drag&drop cli tool.
Useful in combination with a keybinding tool (I use Hammerspoon), and situations when you might not want to drag stuff around, and paste doesn't seem to work - Figma, Notion, Slack - looking at you. In macOS you can also drop folder/file on open/save pane to get to it.
In Hammerspoon I have a key bound to getting current path from clipboard, and drop-cli
-ing it:
-- force drop
hs.hotkey.bind({ "ctrl", "cmd" }, "d", function()
local path = hs.pasteboard.getContents()
hs.execute("drop-cli " .. path, true)
end)
Xcode
- Swift 5 Runtime Support for Command Line Tools
- tested on macOS Sonoma 14.1
Either through Xcode
or ./compile.sh
.
Place your mouse over a drop target and run drop-cli path_to_file.png
or drop-cli http://some-hosted-file.png
(URLs are first downloaded before being dropped - useful for google images).
drop-cli
will generate synthetic drop event at current mouse position.
- inspired by/adapted from
drag
- thanks to Kevin Lynagh for making me accountable to build this :)