StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 General Action Scripts
 copy A file's name to B's file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

leecy1901

7 Posts

Posted - 04/20/2016 :  01:21:45  Show Profile  Reply with Quote
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
2516 Posts

Posted - 04/20/2016 :  18:28:58  Show Profile  Visit Rob's Homepage  Reply with Quote
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
Go to Top of Page

leecy1901

7 Posts

Posted - 04/20/2016 :  23:52:11  Show Profile  Reply with Quote
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
Go to Top of Page

Rob

USA
2516 Posts

Posted - 04/20/2016 :  23:54:18  Show Profile  Visit Rob's Homepage  Reply with Quote
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?
Go to Top of Page

Rob

USA
2516 Posts

Posted - 04/20/2016 :  23:56:30  Show Profile  Visit Rob's Homepage  Reply with Quote
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.
Go to Top of Page

Rob

USA
2516 Posts

Posted - 04/20/2016 :  23:57:26  Show Profile  Visit Rob's Homepage  Reply with Quote
Never mind, I see. It's late! :)
Go to Top of Page

Rob

USA
2516 Posts

Posted - 04/21/2016 :  00:01:07  Show Profile  Visit Rob's Homepage  Reply with Quote
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!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000