merging excel into Indesign

hey guys

I want to merge an excel document (tab delimited) into Indesign.
I searched the forum and found some very useful lines of scripts but it’s not realy what am looking for.
my main problem on the moment is to assign the placeholders to the textframes.
My script is already able to make the page and put all the frames and paragraphstyles on the right place and import the tab delimited file. But i have no clue how to assign the placeholders to the textframes, so the text can actually be merged.

I hope somebody can help me or give me a hint

thnx in advance

this is what i already have. (txt between quotes is in dutch ;))



tell application "Adobe InDesign CS5"
	set myDocument to make document
	tell document preferences of myDocument
		set page height to "240mm"
		set page width to "180mm"
		set page orientation to portrait
		tell myDocument
			
			--maken van textframes
			set myTextFrameA to make text frame
			set geometric bounds of myTextFrameA to {"67mm", "10mm", "79.6mm", "170mm"}
			set myTextFrameB to make text frame
			set geometric bounds of myTextFrameB to {"84mm", "10mm", "140mm", "170mm"}
			set myTextFrameC to make text frame
			set geometric bounds of myTextFrameC to {"213.6mm", "10mm", "220.2mm", "71mm"}
			set myTextFrameD to make text frame
			set geometric bounds of myTextFrameD to {"231mm", "10mm", "232.8mm", "100mm"}
			set myTextFrameE to make text frame
			set geometric bounds of myTextFrameE to {"190mm", "109mm", "220mm", "179mm"}
			set myRectangle to make rectangle with properties {geometric bounds:{"10mm", "10mm", "50mm", "122mm"}, stroke weight:0}
			set myLine to make graphic line with properties {geometric bounds:{60, 10, 60, 170}, stroke weight:1, stroke color:"Black", stroke alignment:inside alignment}
			
			--Creëer de paragraafstijlen
			set myPara1Style to make paragraph style with properties {name:"Koptext", applied font:"Helvetica Neue LT Std	45 Light", point size:48}
			set mypara2Style to make paragraph style with properties {name:"Info", applied font:"Helvetica Neue LT Std	45 Light", point size:24}
			set myPara3Style to make paragraph style with properties {name:"Van_prijs1", applied font:"Helvetica Neue LT Std	45 Light", point size:24}
			set mypara4Style to make paragraph style with properties {name:"voor_prijs1", applied font:"Helvetica Neue LT Std	45 Light", point size:100}
			set mypara5Style to make paragraph style with properties {name:"Codering", applied font:"Helvetica Neue LT Std	45 Light", point size:7}
			set mypara6Style to make paragraph style with properties {name:"Percentage", applied font:"Helvetica Neue LT Std	45 Light", point size:100}
			
			--pas de pragraafstijlen toe
			tell text of myTextFrameA
				apply paragraph style using myPara1Style
				tell text of myTextFrameB
					apply paragraph style using mypara2Style
					tell text of myTextFrameC
						apply paragraph style using myPara3Style
						tell text of myTextFrameD
							apply paragraph style using mypara5Style
							tell text of myTextFrameE
								apply paragraph style using mypara4Style
							end tell
						end tell
					end tell
				end tell
			end tell
			
			--selecteer het te mergen bestand
			tell application "Adobe InDesign CS5"
				set myDocument to the front document
				set thisDataMerge to data merge 1 of myDocument
				set thisDataSource to choose file without invisibles
				select data source of thisDataMerge data source file thisDataSource
				set placeholder to myTextFrameA
				
				merge records thisDataMerge
				
				
				fit contents of myRectangle given frame to content
				
			end tell
		end tell
	end tell
end tell

Hi.
A data merge is an automation method unto itself”a manual one. Scripting your events can accomplish everything that a data merge does and offers greater flexibility. Using AS to merely invoke a merge is a broken system. The scripting method would be to label the frames, place the content, and act on that content. There are many previous posts that cover those topics, and they should also be introduced in Adobe’s scripting guides.

Hi Marc

I understand what you’re saying, and it boggled my mind as well (there’re many ways to Rome so to speak), which raises the question how to solve this problem as a whole.
But the case is that, we get a file and it has to go in ID, and the file has 1 variable cell, that cell tells which masterpage should be used. So i thought it would be easier to use AS to make the layout, it cost to much time for DTP to make it.
I’ve several ‘normal’ merging flows, but because of the 1 variable cell i have to script it.

regards

Harald