"Can’t get paragraph 1 of text frame..."

Hello all,

I was just updated to CS5 (OS 10.6.8) and I am now going through some of my old CS4 InDesign scripts and updating those.

I am getting an error message on a really basic line of code and cannot figure out why it no longer works.

The error message:
Adobe InDesign CS5 got an error: Can’t get paragraph 1 of text frame “tag_box” of document 1.

The text frame is label “tag_box” through the Script Label in InDesign and there’s content in the text frame to copy. I am stuck.

Any help would be greatly appreciated.

Thanks!
~Marinda


tell application “Adobe InDesign CS5”
activate
repeat until Current_Rec - 1 = batchEnd
open MstrDoc

–I am using inData to format text within InDesign file, that’s what the following 3 lines represent.
import data from file (dataDoc as text) using prototype story “proto1” into story “name” starting with record Current_Rec ending with record Current_Rec

	import data from file (dataDoc as text) using prototype story "proto2" into story "label" starting with record Current_Rec ending with record Current_Rec
	
	import data from file (dataDoc as text) using prototype story "proto3" into story "PDF" starting with record Current_Rec ending with record Current_Rec
	
	
	tell document 1

–This is where the script stops and gives me the above error message.
copy (paragraph 1 of text frame “tag_box”) to FileName
if length of FileName > 25 then
set FileName to (characters 1 thru 25 of FileName)
end if
end tell

	save document 1 to (Mstrfolder & "Originals:" & (FileName as text) & ".indd") without template
	
	close document 1
	
	set Current_Rec to Current_Rec + 1
end repeat

end tell

text frame 1 whose label is "aLabel"

Works like a charm!

Thank you so much,
~M :smiley: