type() functions type incorrect characters

Asked by itsmetwenty

OS: Mac Mojave

When I used the following command in SikuliX, the outputted string is incorrect.

Code:

type("/Users/abc/Desktop/a_b_c&D/File1")

Outputted:
"?Users/abc/DESKTOP/a_b_c&D?FILE!"

I already adjusted the typedelay but I still encountered the issue.
Type() function works perfectly in Sierra and High Sierra, I only encounter this issue in Mojave

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Asheru (asheru93) said :
#1

Try with:

 paste("yourText")

Revision history for this message
itsmetwenty (itsmetwenty) said :
#2

I already tried the paste function.
However, the app under test does not support pasting in the text box

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

Tried on my macOS 10.14: works as expected: (latest 1.1.4)

switchApp("textedit"); wait(1)
type("/Users/abc/Desktop/a_b_c&D/File1")

had to switch the keyboard though to "english ABC" (I have a german environment).

So it might be a problem with your special textfield.

Revision history for this message
itsmetwenty (itsmetwenty) said :
#4

I think I found the cause for the incorrect character
it is due to the creation of instance of the app

here is the code:

import thread

global thread_end
thread_end = False

def thread1():
    while thread_end == False:
        AppTest = App("TextEdit")
    print "END"

first_thread = threading.Thread(target=thread1)
first_thread.start()

switchApp("textedit")
for i in range(20):
    type("/Users/AbCdEFGhij/a_b_c_1_2_3_4_5_6_7_8_9_0/!@#$%67890" + Key.ENTER)
thread_end

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

supposing the test with textedit worked.