Jump to content

Applescript Error

  • Please log in to reply
1 reply to this topic



    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 2 posts
Hi, I'm very new to scripting but am trying to learn by creating some scripts I could use.
I found this script that would be useful in creating slugs (file/project information for a particular project) in InDesign.
Unfortunately, when I try to run it, I get this error message:

"Adobe InDesign CS2 got an error: Can't set contents of every page item whose label = "slug logo title" to "Company Name, Proof, etc"."

If someone could help advise me where I'm going wrong I would greatly appreciate it.
Here is the applescript I have created:

tell application "Adobe InDesign CS2"
set myDocument to active document
set mySlugText to "Company Name, Proof, etc"

--Doc Bleed & Slug area setup
set thisDocHeight to page height of document preferences
set slugHeight to 5.25 --all measurements in picas
set thisDocBBleed to (document bleed bottom offset of document preferences)
set thisDocBSlug to thisDocBBleed + slugHeight
set slug bottom offset of document preferences to thisDocBSlug

--Text box for the book title & ISBN
set slugTitleHeight to 1.25 --pi
set slugTitleWidth to 25 --pi
set slugXTitleOffset to 1.25 --pi
set slugYTitleOffset to 1 --pi
set mySlugTitleBounds to {thisDocHeight + thisDocBBleed + slugYTitleOffset, slugXTitleOffset, thisDocHeight + thisDocBBleed + slugYTitleOffset + slugTitleHeight, slugXTitleOffset + slugTitleWidth}

tell every page of myDocument
set titleRect to make new text frame with properties {stroke color:swatch "None" of myDocument, geometric bounds:mySlugTitleBounds, label:"slug logo title", fill color:swatch "Paper" of myDocument}
end tell
set contents of every page item whose label = "slug logo title" to mySlugText
end tell
Posted ImagePosted ImagePosted Image

Posted Image



    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 1 posts
  • Gender:Male
  • Location:Memphis, TN
I've seen this exact same script posted for CS3, and presumably would work in CS4 as well. But I also get the same error when trying to run it. :(

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2017 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy