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