why woun't this work

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.

HTH
Craig

Hi,

Illustrator probably needs the date as a text string. Also you don’t need to ask the Finder to give you the current date.

Try changing:

tell application "Finder"
    set myDate to current date
end tell

to:

set myDate to (current date) as string

Best wishes

John M

thanks guys! :D:D:D

Any one know how I can modify the date to just be month day and year like 9-8-05

Hi,

Take a look here:

http://macscripter.net/faq/get_the_faq.php?id=211_0_10_0_C

Best wishes

John M