Page 1 of 1

Controlling the size of a window

Posted: 2016-04-24 00:20:29
by vwnisus
I am new to Nisus (and the macro language).

Is it is possible to control the size of a document window?

I would like to open a particular file, turn off toolbars and set the zoom to a particular percentage. All of which I see the right commands in Nisus.

But also I would to position the document window in one side of the screen. Is this possible with the macro language?

Re: Controlling the size of a window

Posted: 2016-04-25 09:29:46
by phspaelti
If memory serves the old Nisus Classic macro language had commands to set the window, but not the current macro language.
This is one area where you can use AppleScript, and you can use the Nisus Writer macro language "Run AppleScript" command from inside a Nisus Writer macro.
Here is an example. You'll obviously have to experiment with the size specification to get the desired result:

Code: Select all

$code = 'tell application "Nisus Writer Pro" to set the bounds of the front window to {500, 25, 1550, 850}'
Run AppleScript $code

Re: Controlling the size of a window

Posted: 2016-04-26 17:03:10
by martin
If you just want to control the position of the window (and not its size), you can do so using NWP's macro language:

Code: Select all

$doc = Document.active
$doc.windowOrigin = Size.new(50,50)
But Philip is right that you'll have to dip into AppleScript to change the window size.