← Back to team overview

sikuli-driver team mailing list archive

[Question #185777]: copy and paste text from web page to variable or anything

 

New question #185777 on Sikuli:
https://answers.launchpad.net/sikuli/+question/185777

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(Pattern("Projectspost-2.png").targetOffset(7,-1))
type("c", KEY_CTRL)
#above works perfect
name = input("Please enter your name to log in:")
paste()
fails

The following fails
doubleClick(Pattern("Projectspost-2.png").targetOffset(7,-1))
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?

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.