Author |
Topic |
|
leecy1901
7 Posts |
Posted - 04/20/2016 : 01:21:45
|
i made a code for copy A file's name to B's file.
first , select A file and then mouse cursor on B file and press mouse middle button ,B file's name change to A file's
i write this code in global lua
function sp_middle_mouse_down() if acGetClassName(acGetForegroundWindow(), gsx,gsy) == "CabinetWClass" then acSendKeys("{F_2}^c") acMouseClick(acGetMouseLocationX(), acGetMouseLocationY(), 2, 1, 1) acDelay(200) acSendKeys("{F_2}^v~") end end
and i allowed middle click script in preference.
but its still not working .
i'm wondering how can fix it to work |
|
Rob
USA
2615 Posts |
Posted - 04/20/2016 : 18:28:58
|
This works for me:
if acGetClassName(acGetForegroundWindow(), gsx,gsy) == "CabinetWClass" then acSendKeys("{F_2}") acDelay(200) acSendKeys("^c") acDelay(20) acMouseClick(acGetMouseLocationX(), acGetMouseLocationY(), 2, 1, 1) acDelay(200) acSendKeys("{F_2}") acDelay(20) acSendKeys("^v~") end |
|
|
leecy1901
7 Posts |
Posted - 04/20/2016 : 23:52:11
|
its still not works for me ...
i write in global lua
function sp_middle_mouse_down() if acGetClassName(acGetForegroundWindow(), gsx,gsy) == "CabinetWClass" then acSendKeys("{F_2}") acDelay(200) acSendKeys("^c") acDelay(20) acMouseClick(acGetMouseLocationX(), acGetMouseLocationY(), 2, 1, 1) acDelay(200) acSendKeys("{F_2}") acDelay(20) acSendKeys("^v~") end end
i dont know why its not working.
FYI,im using 2.8.6.4 portable version |
|
|
Rob
USA
2615 Posts |
Posted - 04/20/2016 : 23:54:18
|
Do you have the source file already selected (highlighted) before drawing? I assumed that was your intent, if the file wasn't already selected, it didn't work for me. What's happening when you try to do it? |
|
|
Rob
USA
2615 Posts |
Posted - 04/20/2016 : 23:56:30
|
Wait, this is in the middle click? How are you selecting the two files? It would just copy and paste the same file name to the file at the mouse location from what I can tell. |
|
|
Rob
USA
2615 Posts |
Posted - 04/20/2016 : 23:57:26
|
Never mind, I see. It's late! :) |
|
|
Rob
USA
2615 Posts |
Posted - 04/21/2016 : 00:01:07
|
I didn't bind mine to the middle click done I was on my laptop. Have you tried sending the middle mouse up event? Since this fires on the mouse down, it could think you're pressing middle and left at the same time. You may need even need to utilize acConsumePhysicalInput during this script. On my phone so I can't help much, do a forum search for that function. But make sure you call it at the end with 0 or you won't be able to use the computer if you only stop all input and never reset it! |
|
|
|
Topic |
|
|
|