Adobe 27510753 Scripting Guide - Page 103

to marker, set applied character style of character -1 of parent story

Page 103 highlights

Adobe InDesign CS2 Scripting Guide Working with Documents in AppleScript 95 set myDate to current date set myString to "Author:" & tab & author & tab & "Description:" ¬ & tab & description & return & "Creation Date:" & tab & myDate ¬ & tab & "Email Contact" & tab & myEmail end tell set myLeftSlug to make text frame with properties ¬ {item layer:layer "Slug" of myDocument, ¬ geometric bounds:{(page height of document preferences of myDocument) ¬ + 36, right of myMarginPreferences, ¬ (page height of document preferences of myDocument) + 144, ¬ myRightMargin}, contents:myString} tell parent story of myLeftSlug convert to table text 1 end tell --Body text master text frame. set myLeftFrame to make text frame with properties ¬ {item layer:layer "BodyText" of myDocument, ¬ geometric bounds:{top of myMarginPreferences, ¬ right of myMarginPreferences, myBottomMargin, myRightMargin}} end tell tell page 2 set myMarginPreferences to margin preferences set myLeftMargin to left of myMarginPreferences set myRightMargin to (page width of document preferences of myDocument) ¬ - (right of myMarginPreferences) make guide with properties {orientation:vertical, location:myLeftMargin, ¬ item layer:layer "GuideLayer" of myDocument} make guide with properties {orientation:vertical, location:myRightMargin,¬ item layer:layer "GuideLayer" of myDocument} set myRightFooter to make text frame with properties ¬ {item layer:layer "Footer" of myDocument, ¬ geometric bounds:{myBottomMargin + 14, left of myMarginPreferences, ¬ myBottomMargin + 28, myRightMargin}} set contents of insertion point 1 of parent story of myRightFooter ¬ to auto page number set contents of insertion point 1 of parent story of myRightFooter ¬ to Em space set contents of insertion point 1 of parent story of myRightFooter ¬ to section marker set applied character style of character -1 of parent story of ¬ myRightFooter to character style "page_number" of myDocument set applied paragraph style of paragraph 1 of parent story of ¬ myRightFooter to paragraph style "footer_right" of myDocument --Slug information. set myRightSlug to make text frame with properties ¬ {item layer:layer "Slug" of myDocument, ¬ geometric bounds:{(page height of document preferences of myDocument) ¬ + 36, left of myMarginPreferences, ¬ (page height of document preferences of myDocument) + 144, ¬ myRightMargin}, contents:myString} tell parent story of myRightSlug convert to table text 1 end tell --Body text master text frame. set myRightFrame to make text frame with properties ¬ {item layer:layer "BodyText" of myDocument, ¬ geometric bounds:{top of myMarginPreferences, ¬ left of myMarginPreferences, myBottomMargin, myRightMargin}} end tell end tell --Add section marker text--this text will appear in the footer. set marker of section 1 of myDocument to "Section 1" --When you link the master page text frames, one of the frames sometimes --becomes selected. Deselect it. select nothing end tell end tell

  • 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
95
set myDate to current date
set myString to "Author:" & tab & author & tab & "Description:"
¬
& tab & description & return & "Creation Date:" & tab & myDate
¬
& tab & "Email Contact" & tab & myEmail
end tell
set myLeftSlug to make text frame with properties
¬
{item layer:layer "Slug" of myDocument,
¬
geometric bounds:{(page height of document preferences of myDocument)
¬
+ 36, right of myMarginPreferences,
¬
(page height of document preferences of myDocument) + 144,
¬
myRightMargin}, contents:myString}
tell parent story of myLeftSlug
convert to table text 1
end tell
--Body text master text frame.
set myLeftFrame to make text frame with properties
¬
{item layer:layer "BodyText" of myDocument,
¬
geometric bounds:{top of myMarginPreferences,
¬
right of myMarginPreferences, myBottomMargin, myRightMargin}}
end tell
tell page 2
set myMarginPreferences to margin preferences
set myLeftMargin to left of myMarginPreferences
set myRightMargin to (page width of document preferences of myDocument)
¬
- (right of myMarginPreferences)
make guide with properties {orientation:vertical, location:myLeftMargin, ¬
item layer:layer "GuideLayer" of myDocument}
make guide with properties {orientation:vertical, location:myRightMargin,¬
item layer:layer "GuideLayer" of myDocument}
set myRightFooter to make text frame with properties
¬
{item layer:layer "Footer" of myDocument,
¬
geometric bounds:{myBottomMargin + 14, left of myMarginPreferences,
¬
myBottomMargin + 28, myRightMargin}}
set contents of insertion point 1 of parent story of myRightFooter
¬
to auto page number
set contents of insertion point 1 of parent story of myRightFooter
¬
to Em space
set contents of insertion point 1 of parent story of myRightFooter
¬
to section marker
set applied character style of character -1 of parent story of
¬
myRightFooter to character style "page_number" of myDocument
set applied paragraph style of paragraph 1 of parent story of
¬
myRightFooter to paragraph style "footer_right" of myDocument
--Slug information.
set myRightSlug to make text frame with properties
¬
{item layer:layer "Slug" of myDocument,
¬
geometric bounds:{(page height of document preferences of myDocument) ¬
+ 36, left of myMarginPreferences,
¬
(page height of document preferences of myDocument) + 144,
¬
myRightMargin}, contents:myString}
tell parent story of myRightSlug
convert to table text 1
end tell
--Body text master text frame.
set myRightFrame to make text frame with properties
¬
{item layer:layer "BodyText" of myDocument,
¬
geometric bounds:{top of myMarginPreferences,
¬
left of myMarginPreferences, myBottomMargin, myRightMargin}}
end tell
end tell
--Add section marker text--this text will appear in the footer.
set marker of section 1 of myDocument to "Section 1"
--When you link the master page text frames, one of the frames sometimes
--becomes selected. Deselect it.
select nothing
end tell
end tell