Adobe 27510753 Scripting Guide - Page 97

Setting text-formatting defaults, Setting application text defaults

Page 97 highlights

Adobe InDesign CS2 Scripting Guide Working with Documents in AppleScript 89 Setting text-formatting defaults You can set the default text-formatting attributes for your application or for individual documents. If you set the text-formatting defaults for the application, they become the defaults for all new documents-existing documents remain unchanged. When you set the text-formatting defaults for a document, any new text that you put into the document uses those defaults, and any existing text remains unchanged. Setting application text defaults To set the text-formatting defaults for your application: --ApplicationTextDefaults.as --An InDesign CS2 AppleScript --Sets the application text defaults, which will become the text defaults for all --new documents. Existing documents will remain unchanged. Note that all of --these properties could be set using a single "with properties" statement--we've --split them into separate statements here for the sake of clarity. tell application "Adobe InDesign CS2" set myBlackSwatch to color "Black" set myNoneSwatch to swatch "None" tell text defaults set align to baseline to true try set applied font to font "Minion Pro" end try try set font style to "Regular" end try try set applied language to "English: USA" end try set auto leading to 100 set balance ragged lines to false set baseline shift to 0 set capitalization to normal set composer to "Adobe Paragraph Composer" set desired glyph scaling to 100 set desired letter spacing to 0 set desired word spacing to 100 set drop cap characters to 0 if drop cap characters is not equal to 0 then set drop cap lines to 3 --Assumes that the application has a default character style --named "myDropCap" set drop cap style to character style "myDropCap" end if set fill color to myBlackSwatch set fill tint to 100 set first line indent to "14pt" set gradient fill angle to 0 set gradient fill length to 0 set grid align first line only to false set horizontal scale to 100 set hyphenation to true set hyphenate after first to 3 set hyphenate before last to 4 set hyphenate capitalized words to false set hyphenate ladder limit to 1 set hyphenate words longer than to 5 set hyphenation zone to "3p" set hyphen weight to 9 set justification to left align set keep all lines together to false set keep lines together to true

  • 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 AppleScript
89
Setting text-formatting defaults
You can set the default text-formatting attributes for your application or for individual documents. If you set
the text-formatting defaults for the application, they become the defaults for all new documents—existing
documents remain unchanged. When you set the text-formatting defaults for a document, any new text that
you put into the document uses those defaults, and any existing text remains unchanged.
Setting application text defaults
To set the text-formatting defaults for your application:
--ApplicationTextDefaults.as
--An InDesign CS2 AppleScript
--Sets the application text defaults, which will become the text defaults for all
--new documents. Existing documents will remain unchanged. Note that all of
--these properties could be set using a single "with properties" statement--we’ve
--split them into separate statements here for the sake of clarity.
tell application "Adobe InDesign CS2"
set myBlackSwatch to color "Black"
set myNoneSwatch to swatch "None"
tell text defaults
set align to baseline to true
try
set applied font to font "Minion Pro"
end try
try
set font style to "Regular"
end try
try
set applied language to "English: USA"
end try
set auto leading to 100
set balance ragged lines to false
set baseline shift to 0
set capitalization to normal
set composer to "Adobe Paragraph Composer"
set desired glyph scaling to 100
set desired letter spacing to 0
set desired word spacing to 100
set drop cap characters to 0
if drop cap characters is not equal to 0 then
set drop cap lines to 3
--Assumes that the application has a default character style
--named "myDropCap"
set drop cap style to character style "myDropCap"
end if
set fill color to myBlackSwatch
set fill tint to 100
set first line indent to "14pt"
set gradient fill angle to 0
set gradient fill length to 0
set grid align first line only to false
set horizontal scale to 100
set hyphenation to true
set hyphenate after first to 3
set hyphenate before last to 4
set hyphenate capitalized words to false
set hyphenate ladder limit to 1
set hyphenate words longer than to 5
set hyphenation zone to "3p"
set hyphen weight to 9
set justification to left align
set keep all lines together to false
set keep lines together to true