Article View: adobe.scripting.indesign
Article #16778Re: Script to make a contact sheet?
From: Jay Fraser
Date: Fri, 01 Aug 2003 21:15
Date: Fri, 01 Aug 2003 21:15
58 lines
3220 bytes
3220 bytes
Hey, that was almost easy ... makes me suspicious. I copied most of the new stuff straight from Shirley Hopkins' book:
set theHD to (path to startup disk as string)
set theFolder to theHD & "Photos"
tell application "Finder"
set fileList to name of every file of folder theFolder
end tell
set frameCounter to 1
tell application "InDesign 2.0.2"
tell document 1
set theMaster to master spread 1 -- needed when adding pages later
get master page items of page -1 -- overrides items from master
-- loop through pics
repeat with aPic in fileList
-- get name of pic for caption
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {":"}
set picName to text item -1 of (aPic as text)
set AppleScript's text item delimiters to oldDelims
set aPicPath to theFolder & ":" & aPic
try -- we try, in case there isn't a frame of the right label
place aPicPath on rectangle (frameCounter as text) of page -1
fit result given proportionally
set contents of text frame (frameCounter as text) of page -1 to picName
on error -- we've run out of frames on the page
set frameCounter to 1 -- reset counter
make page at end with properties {applied master:theMaster} -- add page
get master page items of page -1 -- override master items
place aPicPath on rectangle (frameCounter as text) of page -1
fit result given proportionally
set contents of text frame (frameCounter as text) of page -1 to picName
end try
set frameCounter to frameCounter + 1 -- increment counter
end repeat
end tell
end tell
This works as a script, not an application. In other words you can run it from within the script editor, so it should give you a better idea of what's going wrong if it breaks.
I re-worked it to assume you have your photos in a folder called "Photos" on the startup disk. If that's too inconvenient, you'll have to re-work the second line. If the photos are in the folder "Kelly" which is in the folder "Jobs", you'll have to change the second line to read
set theFolder to theHD & "Jobs:Kelly"
Make sense? I'd try it w/ a couple of photos, first. Then you can save it as a script to the "scripts" folder in the "InDesign" folder, & run it from within the InDy application.
Good Luck!
Technical Details
Message-ID:
<1dea1a30.16@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!tiscali!newsfeed1.ip.tiscali.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1dea1a30.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,9a5ab23a310cf1ec X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-08-01 14:37:43 PST From: "Jay Fraser" <jayfraser@yahoo.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!tiscali!newsfeed1.ip.tiscali.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Script to make a contact sheet? Message-ID: <1dea1a30.16@WebX.la2eafNXanI> Date: Fri, 1 Aug 2003 14:15:26 -0700 References: <1dea1a30.-1@WebX.la2eafNXanI> Lines: 61 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit