Current position:  Home > Default > Setting myMasterSpread

Setting myMasterSpread

Time:November 30
Advertisement
Hi, this is the first time I have ever played with scripting and I have been putting the pieces together just fine, except for this one error.
What I am trying to do is write a script that will put two text boxes in the upper right corner of my master spread so it reads "last modified: modification date".  I have tried tons of different commands/word combinations but I keep getting an error in trying to set myMasterSpread.  What I have so far is:
tell application "Adobe InDesign CS5.5"
          set myDocument to document
          set myMasterSpread to masterspread("A-Master") of myDocument
          set myLeftPage to page 1 of myMasterSpread
          set myRightPage to page 2 of myMasterSpread
          tell myRightPage
                    set myRightHeader to make text frame
                    set geometric bounds of myRightFooter to {-19, 963, -15, 1108}
                    set first baseline offset of text frame preferences of myRightHeader to leading
  offset
                    set contents of myRightHeader to "last modified:"
                    set point size of character 1 of parent story of myRightFooter to 10
                    set justification of character 1 of myRightHeader to left align
          end tell
          tell myRightPage
                    set myRightHeader to make text frame
                    set geometric bounds of myRightFooter to {-29, 1010, -15, 1146}
                    set first baseline offset of text frame preferences of myRightHeader to leading
  offset
                    set contents of myRightHeader to modification date
                    set point size of character 1 of parent story of myRightFooter to 10
                    set justification of character 1 of myRightHeader to left align
          end tell
end tell
Can someone please help me figure this out??
Thanks!
Advertisement
ok, so now i have:
tell application "Adobe InDesign CS5.5"
          set myDocument to document
          set myMasterSpread to masterspread1 of myDocument
          set myLeftPage to page 1 of myMasterSpread
          set myRightPage to page 2 of myMasterSpread
          tell myRightPage
                    set myRightHeader to make text frame
                    set geometric bounds of myRightHeader to {-19, 963, -15, 1108}
                    set first baseline offset of text frame preferences of myRightHeader to leading
  offset
                    set contents of myRightHeader to "last modified:"
                    set point size of character 1 of parent story of myRightHeader to 10
                    set justification of character 1 of myRightHeader to left align
          end tell
          tell myRightPage
                    set myRightHeader to make text frame
                    set geometric bounds of myRightHeader to {-29, 1010, -15, 1146}
                    set first baseline offset of text frame preferences of myRightHeader to leading
  offset
                    set contents of myRightHeader to modification date
                    set point size of character 1 of parent story of myRightHeader to 10
                    set justification of character 1 of myRightHeader to left align
          end tell
end tell
and i get the error# -1728  error string: can't get masterspread1 of document...