For a Button object named grabMouse, use the following syntax in its Script Action
grabMouse.CaptureMouse()