copy and paste text from web page to a variable in the script
Is it possible to copy and paste text from a web page into sikuli and assign it as a variable?
Example, I can double click on a specific offset, highlight the string copy it to the clipboard
and that is where the problem lies.
I can get paste(0 returning a 1 but not the string
I can manuallu type ctrl +v an past what was successfully copied.
I even tried to launch an input box then paste with ctrl +v and that failed
code
doubleClick(
type("c", KEY_CTRL)
#above works perfect
name = input("Please enter your name to log in:")
paste()
fails
The following fails
doubleClick(
type("c", KEY_CTRL)
name = input("Please enter your name to log in:")
click
wait(2)
type("v", KEY_CTRL)
The only thing I've been able to do is paste into a notebpat type of file, I cannot via sikuli in any way add input to the input box nor assign the string copied via ctrl+c to anything
I tried to follow your example on the blog but get lost in your lambda formulations
Is it possible to type("c", KEY_CTRL) to copy text then assign that string resident to a variable or just to past that string into the sikuli script where I can execute a slice operation befor assigning that string to a variable?
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask surfdork for more information if necessary.