Article View: adobe.scripting.indesign
Article #14618Re: AppleScript for InDesign CS (Mac OS)
From: Rick_E._Johnson
Date: Sat, 24 Jan 2004 04:05
Date: Sat, 24 Jan 2004 04:05
98 lines
4381 bytes
4381 bytes
Shane Stanly posted a script elsewhere in this forum that makes a proof sheet. I tried it and got lots of errors with IDCS, so I made this variation that works:
set theFolder to (choose folder) tell application "Finder"
set bigList to every file of folder theFolder
end tell
set fileList to {}
repeat with i from 1 to count of items in bigList
set f to item i of bigList
set ft to file type of f
set n to the name of f
if ft is "TEXT" then
if n ends with ".ai" then
copy f to end of fileList
end if
end if
if ft is "EPSF" then
copy f to end of fileList
end if
if ft is "PICT" then
copy f to end of fileList
end if
if ft is "TIFF" then
copy f to end of fileList
end if
if ft is "8BPs" then
copy f to end of fileList
end if
if ft is "GIFf" then
copy f to end of fileList
end if
if ft is "PDF " then
copy f to end of fileList
end if
if ft is missing value then
if n ends with ".jpg" or n ends with ".eps" or n ends with ".ai" or
n ends with ".pdf" or n ends with ".pct" or n ends with ".tif" or n ends
with ".bmp" or n ends with ".gif" then
copy f to end of fileList
end if
end if
end repeat
set frameCounter to 1
tell application "InDesign CS"
if the (count of items in fileList) > 0 then
if document 1 exists then
else
open file "Hard Disk:Applications:Adobe InDesign CS:Templates:scatters.indt"
end if
else
return
end if
tell document 1
set theMaster to master spread 1 -- needed when adding pages later
-- loop through pics
repeat with aPic in fileList
set picName to name of aPic
try -- we try, in case there isn't a frame of the right label
set p to page -1
get rectangle "one" of master spread 1 exists
set r to override (rectangle (frameCounter as text) of theMaster)
destination page p
place (aPic as alias) on r
tell r to fit given proportionally
set r to override (text frame (frameCounter as text) of theMaster)
destination page p
set contents of r to picName
on error errmsg -- we've run out of frames on the page
set frameCounter to 1 -- reset counter
set p to make page at end with properties {applied master:theMaster}
-- add page
-- populate frames
set r to override (rectangle (frameCounter as text) of theMaster)
destination page p
place (aPic as alias) on r
tell r to fit given proportionally
set r to override (text frame (frameCounter as text) of theMaster)
destination page p
set contents of r to picName
end try
set frameCounter to frameCounter + 1 -- increment counter
end repeat
end tell
end tell
To use the script you'll need to change "Hard Disk" to the name of your hard disk, then create a template for your proof sheet on a master page, and save it as a template file so that this line of the script can find it:
open file "Hard Disk:Applications:Adobe InDesign CS:Templates:scatters.indt"
The master page has rectangles for the pictures, with script labels "1", "2", etc. (named using the Script Palette), through however many rectangles you have. It also has matching text frames, similarly named. I'm sure this can be improved, but for me it does the job.
Rick
Technical Details
Message-ID:
<2ccf75f8.16@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-23 20:07:37 PST From: Rick_E._Johnson@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.16@webx.la2eafNXanI> Date: Fri, 23 Jan 2004 20:05:09 -0800 References: <2ccf75f8.-1@webx.la2eafNXanI> Lines: 102 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit