Use the ruby code to simulate a mouse click on the sub-menu in menu

sketchup
ruby-api

#1

Hello, in the sketchup ruby API, can I use the ruby code to simulate a mouse click on the sub-menu in menu?
thank you very much!


#2

This can’t be done in Ruby alone. Maybe it can be done with OS specific libraries in other languages but I don’t think it is a good idea. Menu items can be moved or renamed and their names are language specific. What items are available, and thus their indices, also heavily depends on what is selected and has several combinations.

Rather than trying to target a part of the GUI I’d suggest to instead re-create the underlying action in Ruby.


#3

@haiquan What menu item do you want access to ?