To original script created a text box on the page, but now crashes.
The script is....
set TempAttachmentName to "2009 02 12 121212Z"
tell application "Adobe Illustrator"
activate
delay 4
set DialogFlag to 0
repeat 2 times
try
set currentFile to front document
exit repeat
on error
tell application "System Events" to tell process "Adobe Illustrator"
set DialogFlag to DialogFlag + 1
keystroke return
delay 1
end tell
end try
end repeat
set x to 0
repeat until exists document 1
set x to x + 1
delay 0.1
if x = 200 then
set ErrorMessage to ErrorMessage & "There was a problem with an illustrator file that refused to open." & return & return
exit repeat
end if
delay 0.2
end repeat
set PageBounds to «class aiVB» of document 1
set PageHeight to «class pSHh» of document 1
set PageOrigin to «class xxPO» of document 1
if item 2 of PageBounds > PageHeight - 40 then set item 2 of PageBounds to item 2 of PageOrigin
delay 0.2
set theText to make new «class cTXa» at beginning of document 1 with properties {«class cxDT»:«constant eTXte060», «class pCNT»:TempAttachmentName, «class paPs»:{(item 1 of PageBounds) + 20, (item 2 of PageBounds) + 20}}
--rotate theText angle 90 about top left
delay 0.2
set properties of the text of theText to {«class cTXf»:«class cTXf» "IDAutomationHC39M", size:10}
end tell