Function to Read Ruler Settings in Notebook

I would appreciate having a way to read any/all of the current ruler settings in a notebook. A readruler function comes to mind.

mag = readruler(notebook,"mag")
units = readruler(notebook,"rulerUnits")
rmargin = readruler(notebook,"marginright")

I have a utility panel that dumps graphics to a notebook. I can scale the graphics from their raw input size. I would however like to have a way to scale graphics to the current notebook page size (e.g. HALF of the notebook page size rather than half of the raw image size).

Ach! I cannot edit. I will instead change this. A far easier path is to have the option as below.

Notebook pscaling=%, picture={...}

Here, pscaling is a factor (in percent) that scales the picture TO THE CURRENT NOTEBOOK RULER WIDTH. In cases of conflict, scaling={%,%} overrules pscaling.

This would solve my problem directly without further programming needs to read rulers.

For Igor8, I added an undocumented feature to aid in internal testing of Igor. It works like this:

GetSelection notebook, Notebook0, 16; Print S_selection      // Get information about the all rulers
GetSelection notebook, Notebook0, 4+16; Print S_selection        // Get information about the current ruler

Since it is undocumented, this is subject to change.


In reply to by hrodstein

Thanks. I think the better step is to have a scaling factor that is based on the margins of the current ruler. One could then do this ..

Notebook $theNtbk, ruler=Images  // a special ruler with defined margins for images
Notebook pscale=%, picture={...}

I use pscale but perhaps rscale would be better too.