BlueM / cliclick

macOS CLI tool for emulating mouse and keyboard events
https://www.bluem.net
Other
1.59k stars 116 forks source link

Drag and Drop #131

Open jjbauer15 opened 2 years ago

jjbauer15 commented 2 years ago

Hello!

Particularly in the context of Google Chrome, the drag-and-drop feature doesn't seem to be working right. I have tested it with taking a screenshot, for example, which does work. However, when it comes to dragging a recently-downloaded file and dropping it to the drag-and-drop import section of a Google Sheet, it doesn't seem to be dragging the file.

Even further, in the AppleScipt that I have this in, I tested having Cmd+Shift+4 keyed in before the drag and drop, and a screenshot does successfully get taken.

Here is my code, for reference:

cliclick m:112,1026 w:50 dd:112,1026 w:50 du:840,604"

I will say: I have tried it with a number of different variations, including adjusting wait time and including a dm statement between dd and du.

BlueM commented 2 years ago

I’m sorry, but problems like these are impossible for me to give advice for. If something like this doesn’t work as expected, it’s often an issue of timing or an application being in the background – but this is not necessarily reproducible on another Mac. Therefore, even if I had an answer to the question, it wouldn’t necessarily work on your Mac, too.

Having said that, things to try are: experimenting with timing/waiting (which you have already done), experimenting wih foreground / background applications, using -e for a more “natural” series of events and also splitting one cliclick invocation into several invocations (here, for instance before the dd).