Article View: adobe.scripting.indesign
Article #14674Re: AppleScript for InDesign CS (Mac OS)
From: Shane_Stanley
Date: Tue, 20 Jan 2004 21:34
Date: Tue, 20 Jan 2004 21:34
44 lines
2660 bytes
2660 bytes
Serves me right for posting untested code. This version fixes a couple of problems ("tell page picCount" should have been "tell page i" and the fit target was wrong):
set theFolder to (choose folder with prompt "Choose the folder containing the pic files:")
set theFolderPath to theFolder as Unicode text
set theFileNames to list folder theFolder without invisibles
set picCount to count of items of theFileNames
tell application "InDesign CS"
make document with properties {document preferences:{pages per document:picCount, page height:"11 in", page width:"8.5 in", facing pages:false}}
tell document 1
repeat with i from 1 to picCount
tell page i
set newFrame to make rectangle with properties {geometric bounds:{".5 in", ".5 in", "10.5 in", "8 in"}}
set thePic to place (theFolderPath & (item i of theFileNames)) on newFrame
fit newFrame given proportionally
fit newFrame given center content
end tell
end repeat
end tell
beep
display dialog "Finished."
end tell
But I don't see the old problems as likely causes of your errors...
On Jan 21, 2004, at 2:51 AM, Anne Gordon wrote:
I got an error message: "InDesign error: can't make rectangle"
That sounds like the code might have been mangled by wrong line endings. Try the above and see what happens.
On Jan 21, 2004, at 12:42 AM, Rick E.Johnson wrote:
I tried this script to place a folder with a few EPS files and got the error:
"InDesign CS got an error: File some object wasn't found."
Was this on the first file it tried to place? Try with a couple of other files.
Ideally, I'd like to place several images on a page, and set it up as a template document with several rectangles and caption text frames pre-made on a master page. I'm having trouble accessing the master items on the page, though, to place a file into it. I sure hope that's possible...
You need to use the "override" command to override the items on the master pages.
--
Shane Stanley <sstanley@myriad-com.com.au>
Technical Details
Message-ID:
<2ccf75f8.6@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccf75f8.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,d241fb75db1c5450 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-20 13:38:00 PST From: Shane_Stanley@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: AppleScript for InDesign CS (Mac OS) Message-ID: <2ccf75f8.6@webx.la2eafNXanI> Date: Tue, 20 Jan 2004 13:34:39 -0800 References: <2ccf75f8.-1@webx.la2eafNXanI> Lines: 58 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit