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...

Open up "Save As" dialog in javascript

2015-10-11

Hello all,      I am a newbie to scripting and to be honest it makes my head hurt lol, Kudos to all that make this look easy. I found some good resources but following everything is going to take a bit. I have am using the object model viewer and its

Batch renaming and relinking in InDesign CS4

2015-10-11

Is there a plug-in available for InDesign that will batch rename and relink placed images? In Quark, I used Badia Link Renamer which worked perfectly but it's not available for InDesign. (Was told they hope to have it incorporated into BigPicture for

Add cover sheet without affecting existing page numbering?

2015-10-11

I guess the lack of response means either that my question is inappropriate in some way or else it's difficult or impossible to answer! Thanks for letting me post it anyway! This seems to be a very informative site (just figured out how to access it

Make masterpage items in indesign....

-0001-11-30

How can I get my automatic design on the master page? set Vbreedte to (text returned of (display dialog "width?" default answer "")) as string set Vhoogte to (text returned of (display dialog "Height?" default answer "&q

BridgeTalk troubles

-0001-11-30

I am trying to run an InDesign scirpt from Photoshop using a BridgeTalk example from Paul Riggott. The InDesign part works in ESTK with InDesign as the target but not as part of a Photoshop script through BridgeTalk. So I have some questions. 1. What

[CS4/JS] get guide position using script label

-0001-11-30

Hello Scripters, I am trying to get the position of some specific guides of my masterspread, the following code snippet doesnt work:      var myMasterSpread = myDocument.masterSpreads.itemByName("A-Master");      var myX1 = myMasterSpread.guides

Folder selection

-0001-11-30

Hi all, I've got a script to set up a document and import a folder of files to it. I've got a couple of questions about the UI dialogs, now! 1) I'm using the Folder.selectDialog() function to choose the folder where the images are. I'd really like to

[JS][CS5] resize document

-0001-11-30

Hi Part of a script I am writing resized the active doc to the width and height of the selected frame. However, I cannot seem to get InDesign to reduce the page size to anything leaas that 20.5mm.  There are no guides set, there is nothing on the mas