Adobe 27510753 Scripting Guide - Page 167

Setting the active document's defaults, To set the text defaults for the active document

Page 167 highlights

Adobe InDesign CS2 Scripting Guide Working with Documents in VBScript 159 If .RuleBelow = True Then .RuleBelowColor = myInDesign.Colors.Item("Black") .RuleBelowGapColor = myInDesign.Swatches.Item("None") .RuleBelowGapOverPrint = False .RuleBelowGapTint = 100 .RuleBelowLeftIndent = 0 .RuleBelowLineWeight = 0.25 .RuleBelowOffset = 0 .RuleBelowOverPrint = False .RuleBelowRightIndent = 0 .RuleBelowTint = 100 .RuleBelowType = myInDesign.StrokeStyles.Item("Solid") .RuleBelowWidth = idRuleWidth.idColumnWidth End If .SingleWordJustification = idSingleWordJustification.idLeftAlign .Skew = 0 .SpaceAfter = 0 .SpaceBefore = 0 .StartParagraph = idStartParagraph.idAnywhere .StrikeThru = False Rem If StrikeThru is false, attempting to set some of the Rem strikethrough properties will generate an error. Though Rem we've set StrikeThru to false, we've included the properties Rem to provide a more complete example. If .StrikeThru = True Then .StrikeThroughColor = myInDesign.Colors.Item("Black") .StrikeThroughGapColor = myInDesign.Swatches.Item("None") .StrikeThroughGapOverprint = False .StrikeThroughGapTint = 100 .StrikeThroughOffset = 3 .StrikeThroughOverprint = False .StrikeThroughTint = 100 .StrikeThroughType = myInDesign.StrokeStyles.Item("Solid") .StrikeThroughWeight = 0.25 End If .StrokeColor = myInDesign.Swatches.Item("None") .StrokeTint = 100 .StrokeWeight = 0 .Tracking = 0 .Underline = False Rem If Underline is false, attempting to set some of the Rem underline properties will generate an error. Though Rem we've set Underline to false, we've included the properties Rem to provide a more complete example. If .Underline = True Then .UnderlineColor = myInDesign.Colors.Item("Black") .UnderlineGapColor = myInDesign.Swatches.Item("None") .UnderlineGapOverprint = False .UnderlineGapTint = 100 .UnderlineOffset = 3 .UnderlineOverprint = False .UnderlineTint = 100 .UnderlineType = myInDesign.StrokeStyles.Item("Solid") .UnderlineWeight = 0.25 End If .VerticalScale = 100 End With Setting the active document's defaults To set the text defaults for the active document, change this line in the preceding example: with myInDesign.TextDefaults to: with myInDesign.ActiveDocument.TextDefaults

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184

Adobe
InDesign CS2 Scripting Guide
Working with Documents in VBScript
159
If .RuleBelow = True Then
.RuleBelowColor = myInDesign.Colors.Item("Black")
.RuleBelowGapColor = myInDesign.Swatches.Item("None")
.RuleBelowGapOverPrint = False
.RuleBelowGapTint = 100
.RuleBelowLeftIndent = 0
.RuleBelowLineWeight = 0.25
.RuleBelowOffset = 0
.RuleBelowOverPrint = False
.RuleBelowRightIndent = 0
.RuleBelowTint = 100
.RuleBelowType = myInDesign.StrokeStyles.Item("Solid")
.RuleBelowWidth = idRuleWidth.idColumnWidth
End If
.SingleWordJustification = idSingleWordJustification.idLeftAlign
.Skew = 0
.SpaceAfter = 0
.SpaceBefore = 0
.StartParagraph = idStartParagraph.idAnywhere
.StrikeThru = False
Rem If StrikeThru is false, attempting to set some of the
Rem strikethrough properties will generate an error. Though
Rem we’ve set StrikeThru to false, we’ve included the properties
Rem to provide a more complete example.
If .StrikeThru = True Then
.StrikeThroughColor = myInDesign.Colors.Item("Black")
.StrikeThroughGapColor = myInDesign.Swatches.Item("None")
.StrikeThroughGapOverprint = False
.StrikeThroughGapTint = 100
.StrikeThroughOffset = 3
.StrikeThroughOverprint = False
.StrikeThroughTint = 100
.StrikeThroughType = myInDesign.StrokeStyles.Item("Solid")
.StrikeThroughWeight = 0.25
End If
.StrokeColor = myInDesign.Swatches.Item("None")
.StrokeTint = 100
.StrokeWeight = 0
.Tracking = 0
.Underline = False
Rem If Underline is false, attempting to set some of the
Rem underline properties will generate an error. Though
Rem we’ve set Underline to false, we’ve included the properties
Rem to provide a more complete example.
If .Underline = True Then
.UnderlineColor = myInDesign.Colors.Item("Black")
.UnderlineGapColor = myInDesign.Swatches.Item("None")
.UnderlineGapOverprint = False
.UnderlineGapTint = 100
.UnderlineOffset = 3
.UnderlineOverprint = False
.UnderlineTint = 100
.UnderlineType = myInDesign.StrokeStyles.Item("Solid")
.UnderlineWeight = 0.25
End If
.VerticalScale = 100
End With
Setting the active document's defaults
To set the text defaults for the active document, change this line in the preceding example:
with myInDesign.TextDefaults
to:
with myInDesign.ActiveDocument.TextDefaults