Tool
The Tool object refers to a script that the user can interact with by using the mouse and keyboard and can be accessed through the global tool
variable. All its properties are also available in the paper scope.
The global tool
variable only exists in scripts that contain mouse handler functions (onMouseMove, onMouseDown, onMouseDrag, onMouseUp) or a keyboard handler function (onKeyDown, onKeyUp).