I’m trying to write this for Illustrator everything works accept the date part. Any suggestions?
tell application "Adobe Illustrator"
set myName to make new text frame in current document with properties {position:{524, 767}, contents:"Dan Fox"}
set fileName to name of current document
set fileName to make new text frame in current document with properties {position:{524, 738}, contents:fileName}
end tell
tell application "Finder"
set myDate to current date
end tell
tell application "Adobe Illustrator"
make new text frame in current document with properties {position:{524, 727}, contents:myDate}
end tell
In your script myDate is a date class object and you need a string so:
set myDate to (current date) as string
tell application "Adobe Illustrator"
set myName to make new text frame in current document with properties {position:{524, 767}, contents:"Dan Fox"}
set fileName to name of current document
set fileName to make new text frame in current document with properties {position:{524, 738}, contents:fileName}
make new text frame in current document with properties {position:{524, 727}, contents:myDate}
end tell
That may give you a more detailed date string than you want. You could substitute:
set myDate to date string of (current date)
or
set myDate to (short date string of (current date)
You can also parse the date string to create a string of particular elements, such as not including the day of week.