Comment 2 for bug 769837

Revision history for this message
Jim White (jwhite-b) wrote : Re: X-1.0rc3: Env.getClipboard() seems to work only once and does not access real clipboard anymore after using paste()

Env.getClipboard() will get what was last copied in the IDE and will not change. The waits are not strictly necessary in the code below, but I was just making sure that I was not running into a race condition. To reproduce:

1. create an image around a text box that has text in it for clickPattern
2. in the sikuli IDE copy some text from below such as clickPattern.
3. run the below code
sikuli will print: bug:clickPattern instead of bug:text from step 1
if use cmd-v in any editor will be the correct text from step 1

    click(clickPattern)

    type("a",KEY_CMD)
    wait(1)
    type("c",KEY_CMD)
    wait(1)

    print "bug:" + str(Env.getClipboard())