I'm a noob at Applescript, but managed to get the first half of this script to just display the menu. The image is a mouse hover to display the UI Browser result. The syntax for clicking on a menu with a long number instead of a name eluded all my searching. Perhaps a Relative Specifier could work for that specific menu item?
tell application "System Events"
tell process "Remote Desktop Scanner"
tell menu bar 2
click menu bar item 1
click menu item 2 of "menu -9223372036854775808" (this bit failed)
end tell
end tell
end tell
I'm a noob at Applescript, but managed to get the first half of this script to just display the menu. The image is a mouse hover to display the UI Browser result. The syntax for clicking on a menu with a long number instead of a name eluded all my searching. Perhaps a Relative Specifier could work for that specific menu item?
tell application "System Events"
tell process "Remote Desktop Scanner"
tell menu bar 2
click menu bar item 1
click menu item 2 of "menu -9223372036854775808" (this bit failed)
end tell
end tell
end tell
Share
edited Mar 4 at 7:44
bobzIlla
asked Mar 4 at 7:24
bobzIllabobzIlla
1711 silver badge6 bronze badges
9
|
Show 4 more comments
1 Answer
Reset to default 0Turns out that Remote Desktop Scanner app was piggybacking on the native macOS Screen Sharing app. I guess it's useful for 'bookmarking' several server addresses, and providing the toolbar icon. I mistakenly thought I needed a third party solution to VNC to a PC running RealVNC.
Once I got over feelings of derp, I was able to achieve the proper sequence to get the desired behavior. Not sure why it took a doubling up of keystroke return
and key code 36
to execute a working return key press for a pupup window, but this worked for me. Came away learning more about Applescript, thanks so much for the help.
tell application "/System/Library/CoreServices/Applications/Screen Sharing.app" to activate
tell application "System Events"keystroke "192.168.1.130"
keystroke return
key code 36
end tell
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745057546a4608760.html
-9223372036854775808
looks like a bug somewhere, it's0x0x8000000000000000
."menu -9223372036854775808"
is a string. Tryclick menu item 4 of menu 1
. – Willeke Commented Mar 4 at 17:25menus of menu bar 2
? Andmenus of menu bar 1
for that matter? – Mockman Commented Mar 5 at 4:02delay 0.5
to wait for the menu. – Willeke Commented Mar 5 at 4:16