ObjBox Script

Build 1501 on 14/Nov/2017  This topic last edited on: 8/Apr/2016, at 14:18

Description

Performs boxing of selected objects, and removes or changes the margin and weight on existing boxes.

Syntax

ObjBox (sParameters)

sParameters in version 2.3 and newe

String of parameters, in order, or commands

1/ Normal operations

margin(s) values, e.g. 2pt, or 2pt/2pt/4pt/6pt (LM/RM/TM/BM)

border weight, e.g. 1pt or 0pt

fill color, e.g. K or #C20Y80K10

fill tint, e.g. 100

border color e.g. K or #C20Y80K10

border_tint e.g. 100

gradient color (ex boxing mode string)

gradient tint

gradient type 1

gradient type 2

(ex 7)-boxing_mode string

(ex 8)-top rule weight e.g. 2pt or nothing

(ex 9)-bottom rule weight e.g. 2pt or nothing

Left rule (WIP)

Right rule (WIP)

2/ Special operations

"R" = removes box

"Mvalue" e.g. M1pt, or M+2pt, or M-2pt = sets all margins to the value, or increases/decreases margins for a value.

"Wvalue" e.g. W1pt, or W+2pt, or W-2pt = sets border weight to the value, or increases/decreases weight for a value.

sParameters in version 2.2 and earlier

String of parameters, in order, or commands

1/ Normal operations

margin(s) values, e.g. 2pt, or 2pt/2pt/4pt/6pt (LM/RM/TM/BM)

border weight, e.g. 1pt or 0pt

fill color, e.g. K or #C20Y80K10

fill tint, e.g. 100

border color e.g. K or #C20Y80K10

border_tint e.g. 100

boxing_mode, e.g B+S+KT or nothing

top rule weight e.g. 2pt or nothing

bottom rule weight e.g. 2pt or nothing

2/ Special operations

"R" = removes box

"Mvalue" e.g. M1pt, or M+2pt, or M-2pt = sets all margins to the value, or increases/decreases margins for a value.

"Wvalue" e.g. W1pt, or W+2pt, or W-2pt = sets border weight to the value, or increases/decreases weight for a value.

About margin(s)

You can set margin(s) in two ways:

Specify one value e.g."6pt", it is used for left, right, top and bottom margin.

Specify four values, delimited with "/", e.g. "2mm/2mm/8.5pt/8.5pt". The order is LM/RM/TM/BM.

About TM/BM and lock to grid

When setting up the margins for the pages locked to a baseline grid, have in mind that the margin itself is a white space between rule and inner objects. Thus, the sum of top margin and weight has to correspond to the baseline grid; the same for the sum of bottom margin and weight. Example: your baseline grid is 9.5pt. Therefore, if the border weight is 1pt, TM or BM have to be 8.5pt. If the border weight is 1.5pt, TM or BM have to be 8pt.

About boxing mode

Boxing mode is a 7th part of the parameter string, and it is composed of one- or two-letters (without spaces) with meaning, explained in the next column. Note: if the boxing mode is not supplied in the parameter string, this is the default: B+S+KT. If the only parameter is R, M or W, the boxing string is: B-S-KT.

"KT"Keep title height. Default is false.
"KA"Keep height and width of all elements (when boxing with an outer box. Default is false.
"R+"Regroup object if it was grouped; ignore the user preference, defined in Options.Item("F_GroupBox"). If not specified, the user preference is used.
"R-"Do not regroup object; ignore the user preference. If not specified, the user preference is used.
"G+"Align elements to page vertical grid; ignore the user preference, defined in Options.Item("F_Gridlock"). If not specified, the user preference is used.
"G-"Do not align objects to the page vertical grid; ignore the user preference. If not specified, the user preference is used.
"B+"Shrink and box objects. Default is false.
"B-"Don't box objects, just shrink them.
"S+"Select box on exit. Default is False.
"S-"Don't select box on exit.
"D+"Dogleg boxing (slower); ignore the user preference, defined in Options.Item("F_DogLeg"). If not specified, the user preference is used.
"D-"Do not box as dogleg; ignore the user preference. If not specified, the user preference is used.

Examples for version 2.3 and newer

objbox ("3pt,1pt,-,100,K,100,,,,,B+")

Creates a transparent box with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference.

objbox ("R")

Removes boxing and stretches objects.

objbox ("10pt/0/0/0,,,,,,,,B-")

Shrinks selection from left side for 10pt, without putting any box.

objbox ("3pt/6pt/12pt/16pt,1pt,-,100,K,100,,,,,B+")

Creates a transparent box with 3pt left margin, 6pt right margin, 12pt top margin and 16pt bottom margin, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference.

objbox ("3pt,1pt,K,10,K,100,,,,,B+")

Creates a 20% black filled box with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference.

objbox ("3pt,1pt,#C50Y20,100,K,100,,,,,B+")

Creates a 100% filled box in color Cyan 50% and Yellow 20% with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference.

objbox ("3pt,1pt,#C50Y20,100,K,100,,,,,B+,3pt")

Creates a transparent box with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference, and the top rule of 3pt.

objbox ("3pt,1pt,#C50Y20,100,K,100,,,,,B+,3pt,6pt")

Creates a transparent box with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference, the top rule of 3pt, and the bottom rule of 6pt.

objbox "0pt/0pt/12pt/12pt,0pt,Y,100,M,100,,,,,B+S+KT,6pt,6pt"

Creates a yellow background with 0pt left/right margins, and 12pt top/bottom margin, 0pt border weight (inivisible), headline box height is kept and the lock to grid is driven by the user preference, the top and bottom rule of 6pt. Box is selected after.

objbox ("M10pt")

On an existing box, sets all margins to 10pt.

objbox ("M+2pt")

On an existing box, increases all margins for 2pt.

objbox ("M-2pt")

On an existing box, decreases all margins for 2pt.

objbox ("W6pt")

On an existing box, sets border weight to 6pt.

objbox ("W+2pt")

On an existing box, increases border weight for 2pt.

objbox ("W-2pt")

On an existing box, decreases border weight for 2pt.

Examples for version 2.2 and earlier

objbox ("3pt,1pt,-,100,K,100,B+")

Creates a transparent box with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference.

objbox ("R")

Removes boxing and stretches objects.

objbox ("10pt/0/0/0,,,,B-")

Shrinks selection from left side for 10pt, without putting any box.

objbox ("3pt/6pt/12pt/16pt,1pt,-,100,K,100,B+")

Creates a transparent box with 3pt left margin, 6pt right margin, 12pt top margin and 16pt bottom margin, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference.

objbox ("3pt,1pt,K,10,K,100,B+")

Creates a 20% black filled box with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference.

objbox ("3pt,1pt,#C50Y20,100,K,100,B+")

Creates a 100% filled box in color Cyan 50% and Yellow 20% with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference.

objbox ("3pt,1pt,#C50Y20,100,K,100,B+,3pt")

Creates a transparent box with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference, and the top rule of 3pt.

objbox ("3pt,1pt,#C50Y20,100,K,100,B+,3pt,6pt")

Creates a transparent box with 3pt margins, 1pt weight, black color of border with 100%, headline box height is not kept and the lock to grid is driven by the user preference, the top rule of 3pt, and the bottom rule of 6pt.

objbox "0pt/0pt/12pt/12pt,0pt,Y,100,M,100,B+S+KT,6pt,6pt"

Creates a yellow background with 0pt left/right margins, and 12pt top/bottom margin, 0pt border weight (inivisible), headline box height is kept and the lock to grid is driven by the user preference, the top and bottom rule of 6pt. Box is selected after.

objbox ("M10pt")

On an existing box, sets all margins to 10pt.

objbox ("M+2pt")

On an existing box, increases all margins for 2pt.

objbox ("M-2pt")

On an existing box, decreases all margins for 2pt.

objbox ("W6pt")

On an existing box, sets border weight to 6pt.

objbox ("W+2pt")

On an existing box, increases border weight for 2pt.

objbox ("W-2pt")

On an existing box, decreases border weight for 2pt.

See also

ObjBoxDlg Script