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

 All Forums
 General Discussion
 General Discussion
 "Save Image As" script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

limitless1689

Indonesia
8 Posts

Posted - 05/11/2019 :  02:37:51  Show Profile  Reply with Quote
Can anyone help with creating this script?

The mouse hovers on an image in a browser and you draw the gesture and then the save image dialogue opens.

Go Irwan Santoso

Rob

USA
2591 Posts

Posted - 05/11/2019 :  09:12:06  Show Profile  Visit Rob's Homepage  Reply with Quote
This works for me in Chrome, but it relies on the right-click/context menu appearing when you right-click on the image. Other than using a browser plug-in, S+ can't execute commands within a web page.

//Prevent mouse/keyboard input to prevent interfering with script
sp.ConsumePhysicalInput(true);
//Move the mouse to where the gesture started
sp.MouseMove(action.Start);
//Click the right mouse button to open the context menu
sp.MouseClick(action.Start, MouseButtons.Right, true, true); 
//Pause for the menu
sp.Sleep(100);
//Send the "V" key, which in Chrome selects the "Save image as..." menu item
sp.SendVKey(vk.VK_V);
//Stop blocking input
sp.ConsumePhysicalInput(false);
Go to Top of Page

Rob

USA
2591 Posts

Posted - 05/11/2019 :  09:13:43  Show Profile  Visit Rob's Homepage  Reply with Quote
Ack, sorry! That script is for StrokesPlus.net. Hang on, let me install the old StrokesPlus and get that script together.
Go to Top of Page

Rob

USA
2591 Posts

Posted - 05/11/2019 :  09:17:07  Show Profile  Visit Rob's Homepage  Reply with Quote
This should do it. Again, this is setup for Chrome, and wouldn't work if the "Save image as..." menu item isn't there or doesn't accept the letter v to invoke that menu item.
--Prevent mouse/keyboard input to prevent interfering with script
acConsumePhysicalInput(1)
--Move the mouse to where the gesture started
acMouseMove(gsx, gsy) 
--Click the right mouse button to open the context menu
acMouseClick(gsx, gsy, 0, 1, 1) 
--Pause for the menu
acDelay(100)
--Send the "V" key, which in Chrome selects the "Save image as..." menu item
acSendKeys("v")
--Stop blocking input
acConsumePhysicalInput(0)
Go to Top of Page

limitless1689

Indonesia
8 Posts

Posted - 05/25/2019 :  19:05:25  Show Profile  Reply with Quote
Thanks for the help.

Go Irwan Santoso
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