Trying to type in a Google spreadsheet on a remote server using the keystroke command.
Is it possible to use the ‘keystroke’ command on the remote server?
If I enter the keystroke command like the code below, number -1728 is returned.
If I delete the code at line number 8, this script works fine
I want to know why it doesn’t work. and I want to know how to fix it
Both the client and the server Mac have the same MacOS version as 10.15.7.
1 property remoteMachine : “eppc://tom:1234@iMac.local”
2 with timeout of 30 seconds
3 using terms from application “Finder”
4 tell application “Google Chrome” of machine remoteMachine
5 activate
6 tell application “System Events” of machine remoteMachine
7 tell process “Google Chrome”
8 keystroke “hello world!” <———— attention
9 say (the clipboard)
10 end tell
11 end tell
12 end tell
13 end using terms from
14 end timeout