@tatarin, OK, no problem. I'll walk you through it.
You have two options to get the UI elements and AppleScript to click on them:
- UI Browser
- Use the below macro with BBEdit
Make your choice and download/install the indicated files/tools.
Option #1
Using UI Browser is probably the simplest.
You can download and install it, and run the trial version (free) for 15 uses I think.
To learn how to use it, see
-
Tutorial: Using Keyboard Maestro and UI Browser
- A great video by one of our Forum gurus, @DanThomas
- UI Browser Videos and other pages on its web site.
Steps to Get UI Script
(these are approximate steps, more like guidance)
- Open MS Remote Desktop, and make the window of interest frontmost
- Open UI Browser, and click the button "Switch to Screen Reader"
- Move the Mouse over the MS RD, and over the objects you want to click on
- Press ⌘⌃⇧S to capture the UI elements and open in the browser view
- Click the "AppleScript" button and select "Tell Block Wrapper Short"
- Copy & paste into Script Editor, or better, Script Debugger 7.
- Click the "AppleScript" button and select "Click selected element"
- Copy and paste this script into SE/SD AFTER the line "-- insert GUI Scripting statements here:"
- You can now try to compile and run the script.
If you still need help, post the script in a reply, using a Code Block.
Option #2
We will be using my version of Chris @ccstone's macro.
Please download and import into your KM.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@Win List UI Elements of Front Window @FAV.kmmacros (15 KB)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- After you import it into KM (just double-click the ".kmmacros" file), you will need to:
- Enable it
- Assign a trigger. I like a hot key of ⌃F1, but you can use whatever you prefer.
.
- Make sure you have BBEdit installed.
- If you don't have BBEdit already installed, I highly recommend it. It is the best plain text editor available, and has a free version.
.
- If you don't have BBEdit already installed, I highly recommend it. It is the best plain text editor available, and has a free version.
- Now, open your MS Remote Desktop, and make sure the window of interest if frontmost.
- Then trigger the macro.
- This may take a few seconds, and will open the results in BBEdit.
- Save the file in BBEdit, and zip it.
- Upload the zip file (drag/drop, or copy/paste, or use the Forum Editor upload button) to a reply post in this thread.
I'll get notice of your reply and will download and analyze the zipped file.
It should provide us with a hierarchical listing of the UI elements of the MS Remote Desktop window. From that, I should be able to write an AppleScript that will click on the desired Desktops shown in the window.