illustrator CS3 autotitile block

Having an issue with an old example from Ethan Wilde’s excellent Illustrator Scripting book. It no longer works in CS2 or CS3. It basically updates fields in a predefined block of copy with system info.

Not sure if its ok to post but here it goes. When run through in Illustrator CS2 I get the following error:
Syntax Error:
Expected “,” but found class name.

Any help would be appreciated. Thanks

tell application "Adobe Illustrator 10" to set myDocCount to count of documents
if myDocCount > 0 then
	tell application "Adobe Illustrator 10"
		set myFile to name of document 1
		set myPath to file path of document 1
	end tell
	
	tell application "Finder"
		set myDate to creation date of myPath as string
		set myRevised to modification date of myPath as string
		set myEditor to owner of home as string
	end tell
	set myDate to (word 2 of myDate) & " " & (word 3 of myDate) & "," & (word 4 of myDate) as string
	set myRevised to (word 2 of myRevised) & " " & (word 3 of myRevised) & "," & (word 4 of myRevised) as string
	tell application "Adobe Illustrator 10"
		if exists (text art item "titleblock-file" of document 1) then
			set contents of text art item "titleblock-file" of document 1 to myFile
		end if
		if exists (text art item "titleblock-path" of document 1) then
			set contents of text art item "titleblock-path" of document 1 to myPath as string
		end if
		if exists (text art item "titleblock-date" of document 1) then
			set contents of text art item "titleblock-date" of document 1 to myDate
		end if
		if exists (text art item "titleblock-revised" of document 1) then
			set contents of text art item "titleblock-revised" of document 1 to myRevised
		end if
		if exists (text art item "titleblock-editor" of document 1) then
			set contents of text art item "titleblock-editor" of document 1 to myEditor
		end if
	end tell
end if

Mark:

Text art items should be deprecated as of CS. Change them to text frame and see how it works.

BTW, is this script written as it was presented in the book?

Jim Neumann
BLUEFROG

Bullfrog,

Thanks, I stumbled on this answer this morning and will try it.

As far as the way the script was present-yes. Is there a better way to do this?

It’s just incredibly poorly written. Not saying it won’t work just that it looks like it was written by someone just starting out in AS.

Jim

BTW, it’s BLUEFROG, not Bullfrog. :smiley: