How about the following procedure if you are using Windows OS (unfortunately, the ruler disappears when you save a script)?
- Drag the ruler.
- Then, while holding down the left mouse button, right click.
- Now left-click on the window title (at the top of the window).
In my case, the menu should disappear, but the ruler stays.