段落罫線をボックスに合わせる2


前回のものに罫線風のものを追加します。
スクリプトエディタで開く

前境界線と後境界線を重ねて罫線があるようにみせます。
今回のはカラーを勝手に作ります。

set w1 to 0.1 この数値を変えると線幅が変わります。

tell document 1 of application “Adobe InDesign CS5”

set a1 to parent text frames of selection

copy geometric bounds of a1’s item 1 to {p1, p2, p3, p4}

set c1 to fill color of a1’s item 1

try

copy inset spacing of text frame preferences of a1’s item 1 to {i1, i2, i3, i4}

on error

set {i1, i2, i3, i4} to {0, 0, 0, 0}

end try

try

set co1 to make new color with properties {space:CMYK, color value:{10, 10, 10, 0}, name:“uni01”}

end try

try

set co2 to make new color with properties {space:CMYK, color value:{0, 0, 0, 100}, name:“uni02”}

end try

copy properties of selection to {point size:b5}

set g1 to (b5 * 0.25) + i1

set properties of selection to {rule below line weight:p3p1 – (w1 * 2), rule below offset:-g1 + w1, rule below:true, rule below width:text width, rule below right indent:-i4, rule below left indent:-i2, rule below color:“uni01”} –rule below color:c1, 

set properties of selection to {rule above line weight:p3p1, rule above offset:-i1, rule above:true, rule above width:text width, rule above right indent:-i4w1, rule above left indent:-i2w1, rule above color:“uni02”}

end tell