if calling from ‘Ruby Console’ you need to close it…
# move focus to SU viewport by closing RC.
SKETCHUP_CONSOLE.hide
Sketchup.send_action('selectPaintTool:')
# or for one of my own tools I may use
# Sketchup.active_model.select_tool(JcB::Selector.new)
if triggered from a menu item or a UI::Toolbar it should change, so I assume your using a Web or Html dialog…
moving focus from these is harder unless you simply close it. i.e. @my_dlg.close…
the alternative is to ‘toggle’ a separate dialog…
NODLG = UI::WebDialog.new('noDlg', false, '', 0, 0, 0, 0, false) unless defined? NODLG
# move focus to main window...
def de_focus
NODLG.show
NODLG.close
end
then you can call #de_focus after triggering your tool…
Like you guessed @john_drivenupthewall I’m triggering them from an HTMLDialog but unfortunately de_focus trick didn’t work. Do you have anything else you can suggest? For example, removing focus from HTMLDialog without closing it?