I wrote this and as you can guess, it doesn't work for some reason:
Code: Select all
MouseMove 103, 1022
Send "{LButton down}"
Sleep 100
MouseMove 103, 900
Sleep 100
WinActivate ("ahk_exe AfterFX.exe")
Sleep 100
Send "{LButton up}"
Code: Select all
MouseMove 103, 1022
Send "{LButton down}"
Sleep 100
MouseMove 103, 900
Sleep 100
WinActivate ("ahk_exe AfterFX.exe")
Sleep 100
Send "{LButton up}"
Code: Select all
MouseClickDrag "Left", 103, 1022, 103, 900, 5
Yeah that was my first attempt. But the file simply doesn't follow along the cursor. Can you test it for me tho? I mean, just download any image in Chrome and try and open it this way.Rohwedder wrote: ↑05 Jun 2023, 02:02Hallo,
perhaps (untested)?:Code: Select all
MouseClickDrag "Left", 103, 1022, 103, 900, 5
Code: Select all
#Requires AutoHotkey v2.0
q::
{
CoordMode "Mouse", "Screen"
MouseClickDrag "Left", 148, 978, 1914, 325, 5
}
Yeah that seems fine to move it from one monitor to another. But I need a way to Switch between windows in between without breaking the dragging. For example, using SendEvent Up and Down almost does the job, but if I put anything to Switch windows in between them, the dragging breaks.Rohwedder wrote: ↑05 Jun 2023, 02:32I tried this to drags and drop the downloaded image from Chrome (1. Monitor) to Pain.Net (2. Monitor), it works!Code: Select all
#Requires AutoHotkey v2.0 q:: { CoordMode "Mouse", "Screen" MouseClickDrag "Left", 148, 978, 1914, 325, 5 }
Code: Select all
#Requires AutoHotkey v2.0
q::
{
WinGetPos &X, &Y, &Width, &Height, "ahk_exe chrome.exe"
WinSetRegion "0-0 0-" Height " " Width "-" Height " " Width "-0 0-0 200-200 400-200 400-400 200-400 200-200"
, "ahk_exe chrome.exe"
MouseClickDrag "Left", 148, 978, 300, 300, 5
WinSetRegion , "ahk_exe chrome.exe"
}
Holly smoke that's smart. Had to make some adjustments, but got it working. You saved a ton of my time and work. Can't thank you enough man.Rohwedder wrote: ↑05 Jun 2023, 05:46Why do you need a way to switch between windows? Is your chrome window perhaps covering the target window?
Then maybe this example that works for me:
Chrome and Paint.Net below it, both maximized on my 1st monitor. WinSetRegion makes a hole in Chrome so the drag and drop there can drop the image on Paint.Net.Code: Select all
#Requires AutoHotkey v2.0 q:: { WinGetPos &X, &Y, &Width, &Height, "ahk_exe chrome.exe" WinSetRegion "0-0 0-" Width " " Height "-" Width " " Height "-0 0-0 200-200 400-200 400-400 200-400 200-200" , "ahk_exe chrome.exe" MouseClickDrag "Left", 148, 978, 300, 300, 5 WinSetRegion , "ahk_exe chrome.exe" }