🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #14550

Image Catalog

#14550
From: Kari Puikkonen
Date: Wed, 28 Jan 2004 13:45
71 lines
3572 bytes
Sooner or later somebody will ask CS compatible of PlaceAllFilesWithFileName script.

I've modified Olav Kvern's and Chris Paveglio's original script tp work with CS.

PART 1

--PlaceAllFilesWithFileName CS 
--This script attempts to place all files found in a specified folder and adds a label  
--to each frame containing the file name only (is possible to add full path to image). 

set theFolder to choose folder with prompt "Select the folder containing the files you want to place." 
tell application "Finder" 
	set theFiles to every file of folder theFolder 
end tell

--get files in a folder, alphabetically, and of only ID-compatible and specified types 
set fileList to {} 
repeat with i from 1 to count of items in theFiles 
	set theFile to item i of theFiles 
	set theFileType to file type of theFile 
	set theName to the name of theFile 
	if theFileType is "TEXT" then 
		if theName ends with ".ai" then 
			copy theFile to end of fileList 
		end if 
	end if 
	if theFileType is "EPSF" then 
		copy theFile to end of fileList 
	end if 
	if theFileType is "PICT" then 
		copy theFile to end of fileList 
	end if 
	if theFileType is "TIFF" then 
		copy theFile to end of fileList 
	end if 
	if theFileType is "8BPs" then 
		copy theFile to end of fileList 
	end if 
	if theFileType is "GIFf" then 
		copy theFile to end of fileList 
	end if 
	if theFileType is "PDF " then 
		copy theFile to end of fileList 
	end if 
	if theFileType is missing value then 
		if theName ends with ".jpg" or theName ends with ".eps" or theName ends with ".ai" or theName ends with ".pdf" or theName ends with ".pct" or theName ends with ".tif" or theName ends with ".bmp" or theName ends with ".gif" then 
			copy theFile to end of fileList 
		end if 
	end if 
end repeat 
set myNumberOfFrames to (count of items of fileList) 
display dialog (myNumberOfFrames as string) & " files were found to place." with icon 1

--Set up the page layout by entering the number of rows and columns you want. 
display dialog "How many rows down do you need?" default answer "4" with icon 1 
set myNumberOfRows to (text returned of result) as number 
display dialog "How many columns across do you need?" default answer "4" with icon 1 
set myNumberOfColumns to (text returned of result) as number

--If you don't want to remove empty frames, set myRemoveEmptyFrames to false.  
set myRemoveEmptyFrames to true 
display dialog "Do you want to keep extra unfilled boxes or delete them?" buttons {"Keep", "Delete"} with icon 1 default button 2 
if button returned of result is "Keep" then set myRemoveEmptyFrames to false

--ask for the title box on top 
display dialog "What title do you want on the top of the page?" with icon 1 default answer "Catalog" 
set myTitle to text returned of result

--myOffset defines the height of the text frame for the labels.  
set myOffset to 18 
set myFramesPerPage to (myNumberOfRows * myNumberOfColumns)
Technical Details
Message-ID: <2ccfa09e.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,936257a65fbd8bca,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2004-01-28 06:08:00 PST
From: "Kari Puikkonen" <kari.puikkonen@welho.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: Image Catalog
Message-ID: <2ccfa09e.-1@webx.la2eafNXanI>
Date: Wed, 28 Jan 2004 05:45:05 -0800
Lines: 87
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit