Modify Log window size and position in a macro?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Modify Log window size and position in a macro?

Bill Mohler
I would like to resize and relocate the Log window in a macro. Is there
a simple command I'm missing? Or do I need to write and call a little
plugin?
Reply | Threaded
Open this post in threaded view
|

Re: Modify Log window size and position in a macro?

dscho
Hi Bill,

On Sat, 14 Aug 2010, Bill Mohler wrote:

> I would like to resize and relocate the Log window in a macro. Is there
> a simple command I'm missing? Or do I need to write and call a little
> plugin?

You could run this little Javascript, too:

-- snipsnap --
frame = WindowManager.getFrame("Log");
if (frame != null) {
        frame.setSize(240, 280);
        frame.setLocation(100, 0);
}
Reply | Threaded
Open this post in threaded view
|

Re: Modify Log window size and position in a macro?

Rasband, Wayne (NIH/NIMH) [E]
In reply to this post by Bill Mohler
On Aug 14, 2010, at 1:06 PM, Bill Mohler wrote:

> I would like to resize and relocate the Log window in a macro. Is there
> a simple command I'm missing? Or do I need to write and call a little
> plugin?

You can relocate the Log window using the setLocation() macro function:

  if (isOpen("Log")) {
     selectWindow("Log");
     setLocation(10, 50);
  }

To both relocate and resize it you can use the eval() function to run JavaScript code:
 
  script =
    "lw = WindowManager.getFrame('Log');\n"+
    "if (lw!=null) {\n"+
    "   lw.setLocation(10,50);\n"+
    "   lw.setSize(300, 600)\n"+
    "}\n";
  eval("script", script);

-wayne