Scripting help with Indesign 2 - Please HELP

I am a graphic designer who I looking to make my job easier by incorporating a script.
What I need the script to do is work with Indesign 2 where it will take a template with 6-32 image boxes and automatically place required images given in a Excel Spreadsheet. I get an excel spreadsheet that gives a NAV number (number designated to the images) for each of the images starting from 1 going up to 32.

I am looking to make a script to take the numbers in the excel spreadsheet and use those to fill the image boxes “place” command in Indesign 2.

Any help/tips would be appreciated.
I am running OS 10.2.3 with Microsoft Excel for Mac and Indesign 2.

Feel free to also email me at:

Dire need of some help any assistance is appreciated.
Many thanks!

Let me get a bit of clarification.

Are you saying that the need might be anywhere from six up to thirty-six image boxes over all, depending upon the Excel spreadsheet image list?

Repost here with your answers and we’ll see what we can do for ya’.
Btw, can you post a copy/past example of what the spreadsheet will look like?

Well what we have are images of cd covers that we sell. We have an interactive display that has the pictures of our albums where the customers can simply press on the picture to hear music samples.

On each board there are 6 to 32 boxes where the cd cover images are placed.
Now, I get an excel spreadsheet listing our NAV code for each of the albums that we sell in order that they must be placed on the board.

A typical spreadsheet I get looks like this:

Album #____ NAV Code_________Album Title

1__________20369__________Album 1
2__________18354__________Album 2
3__________20489__________Album 3
4__________12548__________Album 4
5__________14568__________Album 5
6__________18612__________Album 6
etc …

so what I need to do is have a script that imports the images in order by album # to a template in Indesign 2. The problem is how Indesign can take the information in the NAV code cells from the excel spreadsheet and place the image called “20369.tif” (for example) into image box #1 on the board.

Hope this clairifies things.

Thanks for your effort in this problem.

Do you have any of the script written so far?
Please post what you have currently.

I don’t have anything yet for Indesign. Just trying to make the move from Quark to Indesign 2 because it has better scripting ablities which I am trying to discover (just aquired it yesterday). For Quark we have a script where it would automatically select each of image boxes one by one and ask to locate the images that I had to type in from an excel printout. It would then properly size them to fit in the image boxes automatically.

There has not yet been any intergration from Excel to Quark just yet, however, we are now looking to see if it’s possible to integrate Indesign and Excel.

I would send you a script that we have for Quark but I’'m not sure how to attach files on these posts.

It may need 2 scripts, one within another or one to generate the other.
I don’t mean for anyone to go too much out of their way, just looking for a good starting point, something I can build on, or some advice on how to start this task.


I have a script that I got off the Adobe InDesign scripting forum which makes a catalog of a selection of files from the finder. I’ve adjusted it for my own needs and have not trapped it for every possible error, but it might be a starting point. i think all you would need is to get the path of the Excel images and get it into the myFileName variable in my script.
Here’s the script:

--If you don't want to remove empty frames, set myRemoveEmptyFrames to false. 
set myRemoveEmptyFrames to true
--Set up the page layout by entering the number of rows and columns you want. 
set myNumberOfRows to 3
set myNumberOfColumns to 3
--myOffset defines the height of the text frame for the labels. 
set myOffset to 24
set myFramesPerPage to (myNumberOfRows * myNumberOfColumns)

tell application "Finder"
		set the myFiles to the selection
		set myNumberOfFrames to count myFiles
		if the myFiles is {} then
			display dialog "Please select items before running this script." buttons {"Cancel"} default button 1
		end if
	on error
	end try
end tell

tell application "InDesign 2.0.2"
	set myDocument to make document
	--Set the measurement units to points if they're not already set to points. 
	set myViewPreferences to view preferences of myDocument
	if horizontal measurement units of myViewPreferences is not points then
		set myOldXUnits to horizontal measurement units of myViewPreferences
		set myResetXUnits to true
		set horizontal measurement units of myViewPreferences to points
		set myResetXUnits to false
	end if
	if vertical measurement units of myViewPreferences is not points then
		set myOldYUnits to horizontal measurement units of myViewPreferences
		set myResetYUnits to true
		set vertical measurement units of myViewPreferences to points
		set myResetYUnits to false
	end if
	set myMarginPrefs to margin preferences
	tell myMarginPrefs
		set column count to 1
		set margin top to 36
		set margin bottom to 72
		set margin left to 36
		set margin right to 36
	end tell
	set myDocumentPreferences to document preferences of myDocument
	set myNumberOfPages to round (myNumberOfFrames / myFramesPerPage) rounding up
	set pages per spread of myDocumentPreferences to 1
	set pages per document of myDocumentPreferences to myNumberOfPages
	set page orientation of myDocumentPreferences to portrait
	set page height of myDocumentPreferences to 792
	set page width of myDocumentPreferences to 612
	set myMarginPreferences to margin preferences of page 1 of myDocument
	set myLeftMargin to margin left of myMarginPreferences
	set myRightMargin to margin right of myMarginPreferences
	set myTopMargin to margin top of myMarginPreferences
	set myBottomMargin to margin bottom of myMarginPreferences
	set myLiveWidth to (page width of myDocumentPreferences) - (myLeftMargin + myRightMargin - 10)
	set myLiveHeight to (page height of myDocumentPreferences) - (myTopMargin + myBottomMargin)
	set myFrameWidth to (myLiveWidth / myNumberOfColumns)
	set myFrameHeight to (myLiveHeight / myNumberOfRows)
	set myPages to pages of myDocument
	--this builds the boxes
	repeat with myCounter from (count myPages) to 1 by -1
		set myPage to item myCounter of myPages
		repeat with myRowCounter from myNumberOfRows to 1 by -1
			set myY1 to myTopMargin + (myFrameHeight * (myRowCounter - 1))
			set myY2 to myTopMargin + (myFrameHeight * myRowCounter)
			repeat with myColumnCounter from myNumberOfColumns to 1 by -1
				set myX1 to myLeftMargin + (myFrameWidth * (myColumnCounter - 1))
				set myX2 to myLeftMargin + (myFrameWidth * myColumnCounter)
				tell myPage to make rectangle with properties {geometric bounds:{myY1, myX1, myY2 - myOffset, myX2 - 10}}
				tell myPage to make text frame with properties {geometric bounds:{myY2 - myOffset, myX1, myY2, myX2 - 10}}
			end repeat
		end repeat
	end repeat
	--this places the files and name
	repeat with myCounter from 1 to myNumberOfFrames
		set myFileName to item myCounter of myFiles as string
		set fileName to name of item myCounter of myFiles as string
		set myRectangle to rectangle myCounter of myDocument
		--path to Excel files here?
		tell myRectangle
			place myFileName
		end tell
		--Position/fit the graphic in the frame. 
		fit myRectangle given content to frame
		fit myRectangle given proportionally
		fit myRectangle given center content
		--Add the file name to the text frame. 
		tell text frame myCounter of myDocument
			set contents to fileName as string
			--set applied paragraph style of paragraph 1 to paragraph style "label" of myDocument
			set properties of paragraph 1 to {applied font:"Lucida Grande", font style:"Bold", point size:6, left indent:20, baseline shift:-4}
		end tell
	end repeat
	--Do cleanup, if necessary. 
	if myRemoveEmptyFrames is true then
		tell myDocument
			tell (every rectangle whose content type is unassigned) to delete
			tell (every text frame whose contents is "") to delete
		end tell
	end if
	--Reset the measurement units, if necessary. 
	if myResetXUnits is true then
		set horizontal measurement units of myViewPreferences to myOldXUnits
	end if
	if myResetYUnits is true then
		set vertical measurement units of myViewPreferences to myOldYUnits
	end if
end tell