NOTE: I answer your question specifically at the end of this post, so don't miss it, but you should read this entire post, because trust me, I know what I'm talking about (but I'm always willing to hear other ideas - in fact, I'd be THRILLED to hear other ideas!).
I have been automating a TON of things in FCPX for many years now, including using JXA to get to the UI elements on screen (not for the faint of heart). I only mention it so that when you post another FCPX question, you might want to tag me because I don't check in very often but I do respond to the email notifications.
I like everything @Zabobon said in his post. I have found using "Find Image" to work just fine with the Inspector - things haven't changed much in a while. With that said, I use Workspaces all the time, and I like @Zabobon's idea of assuming screen coordinates will work. I would put the screen coordinates into a sub-macro - see the following:
Here's my most important advice:
Put everything you can in sub-macros, so if something changes in the UI, you only need to change it in one place.
For example, here's a partial list of my UI sub-macros, in a group named "FCPX UI
":

Of particular note are macros like [FCPX UI] Timeline.GoToBeginning
and [FCPX UI] Timeline.Focus
. Yes, all they do is type a keyboard shortcut. But if I ever need to change that shortcut, I only change it in one place.
I use my macro Copy Macro as Execute Macro to copy a reference to one of those macros, and paste it into a macro so it looks something like this:

Or you could just use my KMFAM macro to make it even easier to insert.
So, to answer your question:
I do what you're talking about all the time, and I usually do it with a sub-macro that returns the screen coordinates of the UI element(s) I want to change. Then all I have to do is "click" at those coordinates, and go from there.
For example, I have this macro:
This returns the x/y screen coordinates of the Inspector fields Pos X
, Pos Y
, Rotation
, and Scale
. Then I can use them like this example:
In closing:
I hope this helps. Feel free to ask questions, or ask for the macro sources, whatever.
However, I won't share a lot of my UI sub-macros without a discussion first, because I'm not going to be responsible for maintaining them when something changes. For some of them, maintaining them is a no-brainer. But the ones that use JXA to hit UI elements are extremely fragile (meaning UI changes can break them). Don't get me wrong - I'll be maintaining them for myself, but if your workflow becomes dependent on them and you can't change them yourself (because of JXA or whatever), don't expect me to jump in and fix them right away. 
Dan