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
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) "c",KEY_ CMD)
wait(1)
type(
wait(1)
print "bug:" + str(Env. getClipboard( ))