Controlling the size of a window

Get help using and writing Nisus Writer Pro macros.
Post Reply
vwnisus
Posts: 15
Joined: 2016-04-24 00:13:31

Controlling the size of a window

Post by vwnisus » 2016-04-24 00:20:29

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?

User avatar
phspaelti
Posts: 943
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Controlling the size of a window

Post by phspaelti » 2016-04-25 09:29:46

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
philip

User avatar
martin
Official Nisus Person
Posts: 4358
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Controlling the size of a window

Post by martin » 2016-04-26 17:03:10

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.

Post Reply