Page 1 of 1

Tab insert macro (previous), and basic macro editing

Posted: 2014-03-24 04:23:09
by foster13
You gave me exactly what I asked for (the macro below).

However, I’m now trying borders around the table cells (varying between and 4 and 5 pt).

The vertical borders don’t show up. (I’ve tried manually narrowing the table by dragging a corner, but have difficulty getting it to ‘lock.’)

1. How do I edit the macro to reduce the table width, or alternatively
2. Can you provide me with another macro about 2/16 - 3/16 narrower, or
3. Is there a way to place a border inside a table cell, instead of outside?

Continuing thanks,

— Susan

# Macro make Smead Easy Slide hanging file folder tab inserts

$doc = Document.active
Insert Table 20, 1
$tbl = $doc.tableSelection.table

# Each sheet has ten tabs, 3.25 wide and 0.875 in height (3 1/4 x 7/8),
# with each tab allotting 0.562 (9/16) for text.
# [The bottom portion of each measures 0.312 (5/16), and folds.]

$tbl.setUserWidthAtColumn 0, 279
$i = 0
while $i < 20
$tbl.setUserHeightAtRow $i, 40.5
$i += 1
$tbl.setUserHeightAtRow $i, 22.5
$i += 1
end

Re: Tab insert macro (previous), and basic macro editing

Posted: 2014-03-24 04:53:37
by phspaelti
foster13 wrote:You gave me exactly what I asked for (the macro below).

However, I’m now trying borders around the table cells (varying between and 4 and 5 pt).

The vertical borders don’t show up. (I’ve tried manually narrowing the table by dragging a corner, but have difficulty getting it to ‘lock.’)
I'm not sure what you mean by "lock". There is (unfortunately) no feature in Nisus to lock tables so they don't change size. The macro I provided earlier just sets the size, but if you change the size, or if you type 'too much' text in a cell, this will override the setting.
Which 'vertical borders' are you talking about? The way the macro works for me, it just shows 1pt solid black around all table cells. That is the Nisus default, I believe.
foster13 wrote: 1. How do I edit the macro to reduce the table width, or alternatively
The width is set in the following line of the macro:

Code: Select all

$tbl.setUserWidthAtColumn 0, 279
The 279 is the column width, and since there is only one column, it is also the table width. The width is set in points which are = 1/72 of an inch.
foster13 wrote: 2. Can you provide me with another macro about 2/16 - 3/16 narrower, or
Do you want 2 or 3? How about 2.5? :) A 1/16 inch = 4.5 points, so you can change the 279 to 270 (for 2/16 narrower) or 265.5 (for 3/16 narrower), or whatever you like. You should be able to figure out the height in the same way if you need to change that.
foster13 wrote: 3. Is there a way to place a border inside a table cell, instead of outside?
Borders are by definition the edges of a table cell. Of course you can just have two cells with a border between them. Where did you want the borders?

Code: Select all

# Macro make Smead Easy Slide hanging file folder tab inserts

$doc = Document.active
Insert Table 20, 1
$tbl = $doc.tableSelection.table

# Each sheet has ten tabs, 3.25 wide and 0.875 in height (3 1/4 x 7/8), 
# with each tab allotting 0.562 (9/16) for text. 
# [The bottom portion of each measures 0.312 (5/16), and folds.]

$tbl.setUserWidthAtColumn 0, 279
$i = 0
while $i < 20
$tbl.setUserHeightAtRow $i, 40.5
$i += 1
$tbl.setUserHeightAtRow $i, 22.5
$i += 1
end

Re: Tab insert macro (previous), and basic macro editing

Posted: 2014-03-24 05:16:30
by phspaelti
Here is a second version of the macro which includes settings for the table cell edges. These are just random settings. Adjust them as needed.
SmeadEasySlideTabInserts.nwm
Version 2 (with line attribute settings)
(17.12 KiB) Downloaded 300 times

Re: Tab insert macro (previous), and basic macro editing

Posted: 2014-03-24 05:45:09
by foster13
You're a genius. Thank you.