Unable to type URL because of shifting problem

Asked by Ryan

Hello, I am trying to have Sikuli type a URL into a form, but have a problem because the shift key is not being activated.

In Sikuli: type("http://google.com")

I want http://google.com to be inserted into the form. Instead, it is typing http;//google.com

I have tried several things including breaking the URL into pieces, saying first type("http") then adding either
type(";", KeyModifier.SHIFT)
type(";", Key.SHIFT)

Unfortunately none of these are working. Any help/suggestions would be appreciated

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

see faq 933
use paste() instead

Revision history for this message
Ryan (m-ryan-g) said :
#2

When I use a paste in this Windows program, it results in only a "v" being inserted, which is why I turned to type()

Revision history for this message
Ryan (m-ryan-g) said :
#3

print() works fine, but neither paste or type work in this situation

Revision history for this message
RaiMan (raimund-hocke) said :
#4

Ok, paste() internally issues a ctrl-v, to paste the text from the prepared clipboard.

Your app seems not to accept paste actions using ctrl-v

what system?
what Sikuli version?
what locale? keyboard layout?

Revision history for this message
Ryan (m-ryan-g) said :
#5

I'm using a 3rd-party email data scraping application that requires pasting URLs of pages to be scraped. ctrl-v and cmd-v both work for me when using the keyboard on my computer, however I can't get sikuli to successfully complete the same tasks.

The program is running on Windows 8 while using Parallels on a Mac w/ OS X 10.9.4.

I'm in the US using the "normal" English keyboard. Does that help?

Thanks a ton for your help!

Revision history for this message
RaiMan (raimund-hocke) said :
#6

I guess you are running the script on the Mac.

If yes: there are some problems with acting on Parallel's window's content.

You might run the script directly in the Windows environment.

If you do not want to do that, you have to check for focus problems and/or timing problems.
Use the low level keyboard actions (keyDown/keyUp) with short wait's to find out.

Sometimes an additional click might help as well.

Can you help with this problem?

Provide an answer of your own, or ask Ryan for more information if necessary.

To post a message you must log in.