Resize Window (newbie)

Get help using and writing Nisus Writer Pro macros.
Post Reply
tedg
Posts: 19
Joined: 2012-09-22 01:52:56
Location: Brisbane, Australia
Contact:

Resize Window (newbie)

Post by tedg »

Would like to relocate and resize the frontmost document window. Tried the following and a few variations.

Is there a repository of example macros?

$doc.windowOrigin = 780;50
$doc.windowSize = 817;2111

Thanks in advance, Ted
User since 1990
Most current NWp
MacBookPro16,1 16-inch 2019

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

Re: Resize Window (newbie)

Post by phspaelti »

Try

Code: Select all

$doc.windowOrigin = Size.new 780, 50
$doc.windowSize = Size.new 817, 2111
philip

tedg
Posts: 19
Joined: 2012-09-22 01:52:56
Location: Brisbane, Australia
Contact:

Re: Resize Window (newbie)

Post by tedg »

Philip,

Searched the forum and see how helpful you have been. Thank you on behalf of all of us.

But that did not fly. Terminate at the end of first line.
User since 1990
Most current NWp
MacBookPro16,1 16-inch 2019

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

Re: Resize Window (newbie)

Post by phspaelti »

Hi Ted,
I guess I thought this was a bit of code you had ripped from a complete macro. :wink:
Of course for this code to work you will have to first define the variable $doc. So for example:

Code: Select all

$doc = Document.active
$doc.windowOrigin = Size.new 780, 50
$doc.windowSize = Size.new 817, 2111
philip

tedg
Posts: 19
Joined: 2012-09-22 01:52:56
Location: Brisbane, Australia
Contact:

Re: Resize Window (newbie)

Post by tedg »

Thanks. I'll build from there and get back.
User since 1990
Most current NWp
MacBookPro16,1 16-inch 2019

Post Reply