This is an area of NWP that is a total mess. The behavior is just all over the place.
Let's consider some things that work.
1. Images can be inline or floating. If your image is floating, you are in luck! You can use the menu command "Edit > Copy > Copy Shape Appearance". Then you can paste them on other floating images (with "Edit > Paste > Paste Shape Appearance"
2. What if your image is inline? In that case those Shape Appearance commands are disabled. Apparently the stroke on an image is different from that of a floating image.
You might think you could work around this problem like this:
- Convert the image to floating
- Copy Shape Appearance
- Convert back to inline
- Select other image
- Convert to floating
- Paste Shape Appearance
- Convert back to inline
This works up to the last step. At that point NWP removes the Shape Appearance again
3. What about macros?
This is a total mine field. Generally Nisus Macro language has an elaborate set of commands and features to set strokes, but these commands are extremely ideosyncratic. The features for the stroke are set using
LineAttributes. You will find them described in the
Table Objects section of the Macro Language Reference. For table cells this works like a charm, though for some reason there are two sets of commmands to set them:
- To get them from a single table cell use .lineAttributesForEdge
- To set them on a single table cell use .setLineAttributesForEdge
- To set them for a selection of table cells use .applyLineAttributesToEdges
Note the intricate arrangement of prepositions and plurals
Now you might have thought that you could do the same for floating content objects, and you can up to a point. Floating content objects have a macro property
.strokeAttributes (more tricky naming) which return a
LineAttributes object. However this property is described as following
value semantics which would seem to mean that it can't be set. This is either a feint to keep out the unwary, or an undocumented change in behavior. In fact
Code: Select all
$myFloatingContent.strokeAttributes = $myLineAttributes
seems to work just fine, except…
When I tried to following very simple code:
Code: Select all
$doc = Document.active
$fcs = $doc.allFloatingContents
$lineAttributes = $fcs[0].strokeAttributes
$fcs[1].strokeAttributes = $lineAttributes
This is the result I got:
Before

- Screen Shot 2022-03-01 at 0.41.51.png (107.97 KiB) Viewed 3563 times
After

- Screen Shot 2022-03-01 at 0.42.09.png (112.15 KiB) Viewed 3563 times
There doesn't seem to be any way to control which edges of the floating content to apply the attributes to.