Is there a way to force getting the numerical values of WindowMargins
instead of Automatic
for a window?
For example let say I want to create a new Notebook that is $62$ pixels below and $62$ pixels to the right of the current EvalutaionNotebook
. If I run the following it sometimes works and sometimes doesn't depending on the window position on the current screen.
x = CurrentValue[EvaluationNotebook[], "WindowMargins"];
NotebookPut[Notebook[{
Cell["Some text.", "Text"]}],
WindowMargins -> {
{x[[1, 1]] + 62, Automatic},
{Automatic, x[[2, 2]] + 62}
}
]
For example sometimes the expression throws an error and results in the following because Mathematica is returning a different answer.
{{131, Automatic}, {Automatic, 62 + Automatic}}