You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to drag and drop an item? For eg an image on powerpoint slide #58
There are usually various ways to get to the same outcome. Try to think of how something is done manually, and then map that series of actions to the UI interaction functions in this tool.
In this case, maybe doing a r.click('image.png') and then doing a r.keyboard('[left][left][left][left][left][left][left][left][left][left][left][left]') can give desired outcome.
Or maybe doing something below to drag and drop left by 100 pixels works?
If above works but too many lines of code, you can write your own Python function to combine the above steps to do what you need, so that you only need to write 1 line to do this action.
Closing issue for now as the implementation should be quite straight forward, the challenge is figuring out the step by step details how a human user manually do the sequence of actions to get it done. Then map to above type of Python code.
changed the title [-]How to drag an item to the left? For eg an image on powerpoint slide[/-][+]How to drag and drop an item? For eg an image on powerpoint slide[/+]on Jan 4, 2020
Adding on to above sample code which drags and drops by coordinates offset, below sample drags and drops from a source image identifier to a target image identifier using visual automation -
If you prefer to keep syntax consistent as r.dragdrop() you can define and map it as follows -
importrpaasrr.init(True)
# define the dragdrop() functiondefdragdrop(source_x, source_y, target_x, target_y):
r.hover(source_x, source_y)
r.mouse('down')
r.hover(target_x, target_y)
r.mouse('up')
# map the function to r objectr.dragdrop=dragdrop# invoke using r.dragdrop()r.dragdrop(200, 100, 600, 200)
r.close()
I'm leaving a dragdrop() or drag() function out from API because it may not be that commonly used and can clutter up the API which contains the essentials plus some pros functions. But if there are users interested and often use something like this I can add a new function into basic functions.
Reacted by RenatoTeixeiradaSilva, Red Boumghar, chengshi guo, John-Ttaolc and Jinhu Ma
Activity
kensoh commentedon Sep 17, 2019
There are usually various ways to get to the same outcome. Try to think of how something is done manually, and then map that series of actions to the UI interaction functions in this tool.
In this case, maybe doing a
r.click('image.png')and then doing ar.keyboard('[left][left][left][left][left][left][left][left][left][left][left][left]')can give desired outcome.Or maybe doing something below to drag and drop left by 100 pixels works?
If above works but too many lines of code, you can write your own Python function to combine the above steps to do what you need, so that you only need to write 1 line to do this action.
kensoh commentedon Sep 18, 2019
Below is an example (for first action, hover will do) -
kensoh commentedon Sep 19, 2019
Closing issue for now as the implementation should be quite straight forward, the challenge is figuring out the step by step details how a human user manually do the sequence of actions to get it done. Then map to above type of Python code.
[-]How to drag an item to the left? For eg an image on powerpoint slide[/-][+]How to drag and drop an item? For eg an image on powerpoint slide[/+]kensoh commentedon Jan 4, 2020
Adding on to above sample code which drags and drops by coordinates offset, below sample drags and drops from a source image identifier to a target image identifier using visual automation -
You can also create a function to drag and drop from the source to the target x,y coordinates -
If you prefer to keep syntax consistent as
r.dragdrop()you can define and map it as follows -kensoh commentedon Jan 4, 2020
I'm leaving a dragdrop() or drag() function out from API because it may not be that commonly used and can clutter up the API which contains the essentials plus some pros functions. But if there are users interested and often use something like this I can add a new function into basic functions.