Saving Clipboard in to a variable

Asked by Sander on 2018-08-02

Hi there,

I've seen a lot of tickets with regards clipboard().

I am using a Mac and installed Sikulix 1.1.2.

Using the following commands:
doubleClick(Pattern(someText).targetOffset(90,-70)) and type("c", KeyModifier.CMD)
someText = App.getClipboard()
print("This is " + str(someText) + " to be printed.")

It looks like that it does not work "sometimes".
Physically using the CMD and 'C' combined does work properly, meaning it prints the correct string.

Is this (what I've been reading) still an issue with JAVA, that simply cannot be solved? Or is there an alternative what I could not find?

Thanks again for the help.

Regards,
Sander

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-08-02
Last reply:
2018-08-03
RaiMan (raimund-hocke) said : #1

First of all I ask you to upgrade to the latest 1.1.3 nightly.
Either use Java 8 or Java 10.

I will not support releases prior to 1.1.3 any longer with respect to system related or Java related problems.

type("c", KeyModifier.CMD)
someText = App.getClipboard()

works definitely.

The problem might be the
doubleClick(Pattern(someText).targetOffset(90,-70))
before.

You should test your workflow step by step and hence avoid such compound constructs like
doubleClick(Pattern(someText).targetOffset(90,-70)) and type("c", KeyModifier.CMD)

better:
doubleClick(Pattern(someText).targetOffset(90,-70))
type("c", KeyModifier.CMD)

and watch, whether really anything is selected by the doubleClick.

Can you help with this problem?

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

To post a message you must log in.