Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

emills

macrumors newbie
Original poster
Jun 29, 2010
4
0
At my company we run an AppleScript that retrieves information from our database program and uses it to place PDF images on the correct layer & page of InDesign documents. We recently upgraded from 10.4.11 to 10.5.8 and have run into some problems.

Now the script is only partially working. The script cannot recognize any page beyond 11. By this I mean all PDF images place correctly on a given layer for pages 1-10. For any page after 11 the script reports that it cannot get that page.

I believe this is because the newer version of AppleScript is completely Unicode text based but the older script is not. How do I get the script to recognize the numbers 11 and above?

Here is an excerpt of the script that I believe is causing the issue. Thank you:

Code:
--pageField of rDatabase = Page Number from database program (entered as plain text)
--docName = Name of INDD file
--imageBox = Frame of INDD Page
--imagePath = Location of PDF file

set nPage to (pageField of rDatabase) as number
placeImageFile(docName, nPage, imageBox, imagePath)

on placeImageFile(xDoc, nPage, imageBox, imagePath)
set imagePath to imagePath as string
tell application "Adobe InDesign CS4"
if {Unicode text, string, number, integer} contains (class of xDoc) then set xDoc to document xDoc
if nPage is not equal to "" then set xDoc to page nPage of xDoc
tell xDoc
if {integer, string, Unicode text} contains {class of imageBox} then
try
set placeRef to page item imageBox
on error
set placeRef to page item imageBox of all page items
end try
else
set placeRef to imageBox
end if
end tell
tell placeRef
place imagePath
end tell
end tell
end placeImageFile
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.