# Cursor doesn't change on Mac when activating a tool from Ruby API

**URL:** <https://forums.sketchup.com/t/cursor-doesnt-change-on-mac-when-activating-a-tool-from-ruby-api/60921>\
**Category:** Ruby API\
**Created:** [January 31, 2018, 9:53am UTC](https://forums.sketchup.com/t/cursor-doesnt-change-on-mac-when-activating-a-tool-from-ruby-api/60921 "2018-01-31T09:53:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![john\_drivenupthewall](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@john\_drivenupthewall](https://forums.sketchup.com/u/john_drivenupthewall)\
**Post date:** [January 31, 2018, 10:44am UTC](https://forums.sketchup.com/t/cursor-doesnt-change-on-mac-when-activating-a-tool-from-ruby-api/60921/2 "2018-01-31T10:44:38Z")

</div>

the mac issue is with window focus…

if calling from ‘Ruby Console’ you need to close it…

```ruby
# 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…

```ruby
 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…

john

---

_[View the full topic](https://forums.sketchup.com/t/cursor-doesnt-change-on-mac-when-activating-a-tool-from-ruby-api/60921)._
