The requested URL returned error: 403 Forbidden Illustrator Script to add a Date and Time to your file » Blog »


Our regularly updated blog has written tutorials, software and product reviews, and links to other cool stuff.

Check out our upcoming workshops and webinars

Illustrator Script to add a Date and Time to your file
By Jason McConnell on May, 16 2015

Space cadets image with wr-dateandtime script

I found this really useful Illustrator Javascript that lets you automatically add the filename, date and time to your file. Its a great way to label your files when printing so you know what the name of the file is and the time it was printed.

It is a free script created by Wolfgang Reszel called wr-dateandtime.js and you can check out his website for more info here.

You’ll need Illustrator 10 and up and I can confirm that it still works for the latest version of Illustrator CC 2014 18.1.1.

Step 1: Download the script

Here is a direct link to the script file that you’ll need to download: wr-dateandtime.js.

Step 2: Copy the script into the Adobe Scripts folder

Lets put the script into Illustrators Default Scripts folder now so it will show up in Illustrators’ Scripts menu.

Adobe Illustrator Default Script Folder location

On a mac the location is:
Applications/Adobe Illustrator CC 2014/Presets/en_US/Scripts

On Windows the location is:
Program Files\Adobe\Adobe Illustrator CSx\Presets\

Your Scripts folder location might differ depending on your Illustrator Version.

Restart Illustrator now if it is open so that wr-dateandtime will show up in the Scripts menu in Illustrator.

Step 3: Add a text box to your file

Add a line of text for the script to run
Add a text box or inline text wherever you would like the filename and date to be. I added a line of text at the bottom right corner of my artboard.

Step 4: Run the script

Make sure your text box is selected and go to File / Scripts and choose the wr-dateandtime script.
Choose the wr-dateandtime script from the Scripts Menu

You will see this wr-dateandtime v0.9 window pop up and lets hit OK for now.
wr-dateandtime window

As you’ll see, it automatically fills in the Filename, Date and Time for you in your text box.
after running wr-dateandtime script your text will update

Step 5: Modify the output of the script

Its really easy to add your own text to the script. Run the script again with the text box selected.

Add your own text to the script

This time enter your own text into the window. I typed in -JM at the end.

Click ok, and then you’ll see the filename, date, time and whatever text you entered into the wr-dateandtime window.

showing updated text after running the script

You can experiment with adding different variables here too including {File}, {FilePath} and {FileExt} which will add things like the full path where your file is located or the file’s extension.

Step 6: Updating the date and time

You don’t have to select your text box again when you want to update the Date and Time stamp. Just run the script again, with nothing selected, and it will find your text box with the date and time and update it automatically.

Step 7: Create an Action to run the script

You can create an Action that will make it faster to run the Script. Open the Actions Panel and from the Drop Down menu choose New Action.
Add an action

Give it a Name (I called mine Date and Time Script) and you might want to select a Function key that you can use to run the Action later. Then click Record.
Set up the action

Next from the Actions Panel Menu choose Insert Menu Item.
Insert Menu Item for the action

Type wr and click Find: and it should find the wr-dateandtime script for you. Press OK.
insert the wr-dateandtime menu item

If you want to add a Print step to the Action go to File / Print and just press Done to exit out of the Print Window. This will record the Print step so you can now stop the Action by clicking the Stop recording button at the bottom of the Actions panel..
Final action

Now when I run my Date and Time Script Action by clicking play or when I click F1 it will run the script, update the date and time and bring up the Print window for me so I can choose my print settings and print.

And remember you don’t need to select the text box before you run the action, it will find your text box(s) that you ran the script on earlier and automatically update the time for you.

OK thats all folks, I hope you find this useful and please share the blog with friends.