Jump to content

Drag document to frontmost app

Recommended Posts

Hi all


Recently I've found that I have a regular requirement to drag a recent document to the software I'm currently in, for example a web browser, or Discord.


To achieve this, I bring up Alfred, type <space><document name>, then take one hand off the keyboard and move it to the trackpad to drag that document into the app.


This is OK, but I'd love if there was some action I could add to Alfred to automate the 'drag to current app' part. I want it to automate the process of dragging and dropping the selected file into whatever app I was in when I brought up Alfred.  Then I could do the whole process with keyboard alone.


Is that possible?



Link to comment
On 11/3/2021 at 9:51 AM, TheBloke said:

Is that possible?


No. Drag-and-drop is fundamentally a monkey-with-a-mouse action. I believe it's possible to simulate, but you're going to find it very difficult to tell your script what it should drag without putting the mouse pointer over it…


Try to find an API for doing whatever it is that drag-and-drop does in the application.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...