Margins

Get help using and writing Nisus Writer Pro macros.
Post Reply
Vanceone
Posts: 108
Joined: 2013-05-03 07:06:31

Margins

Post by Vanceone » 2016-12-06 12:04:24

So I was looking into a macro to write annotations on the left side of a page, in the margin area. Which meant I needed to know the page dimensions, the "writeable" box, etc.

Turns out there is no way to get that info or manipulate the margins? In truth, there appears to be no way to manipulate margins at all. Primarily, it appears that the reason is because there is no way to use the menus to set the margins: it is all palette work, and there is no Macro API to use the palettes.

Can you adjust the page number format either? Section number, or choose the header/footer objects on a page like "Different header footer or "First page footer different"?

Seems like a really crippling limitation if you cannot.

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

Re: Margins

Post by phspaelti » 2016-12-07 00:31:07

Hello VanceOne.
Well, you've pretty much answered your own question. Here is my list of missing Nisus objects and commands in the macro language. I made it a while back, so it's no longer 100% up to date, and a few things may have been taken care of.
Attachments
Missing Commands and Objects (Macro Language).rtf
(31.54 KiB) Downloaded 73 times
philip

Vanceone
Posts: 108
Joined: 2013-05-03 07:06:31

Re: Margins

Post by Vanceone » 2016-12-07 07:23:16

Good list, phspaelti. I would note that I think I've figured out how to create a textbox, and once you have a textbox you can duplicate it and add it to text. The solution that I'm thinking of is to issue the menu command to do a new textbox, then drop into Applescript and issue a couple of mouse commands to draw somewhere, then exit AppleScript.

Following that you can check the floating content stream and pull out your new textbox, then duplicate it attached to the content you need and you can manipulate sizes and so forth.

I think I've seen your list before. Hasn't it been around for a few years now? Has Nisus ever weighed in on why some of those very obvious oversights are not available yet? The Section object in particular; as well as greater control of footnotes/endnotes seems crucial.

One thing to add to your list regarding text boxes: I don't really know how to get the text from them. It is impossible to link them together via the macro language. Also, can you set the float style and wrapping style of floating images?

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

Re: Margins

Post by phspaelti » 2016-12-07 20:37:24

Thanks for your comments.
As for the list; I made it quite a while ago (sometime around when NWP 2.1? was released). I don't think I made it public, but I think I once sent it to Nisus (as part of a longer file). They never said anything about, and I wasn't really expecting them to either. They usually keep their cards pretty close, as far as their plans for future features, which I understand.

Textboxes. Your idea makes sense, have you tried to implement it? I would have used a "library" file containing one sample of each kind and then copied them from there. It occurs to me that creating a glossary would probably be the easiest way to get floating content items.
Getting the text from a textbox is easy:

Code: Select all

foreach $fc in $sel.floatingContents
   if $fc.isTextBox
      $text = $fc.text
   end
end
If you want to change the text you will have to use ".insertAtIndex" or a similar command. You can't just set the text to some other text object. But linking text boxes is another missing feature. I'll have to add that to my list.

Setting the wrap for floating contents can be done by selecting and then using the menu commands (Tools > Shapes > Text Wrapping > …)
philip

Post Reply