Skip to main content
Participant
March 4, 2024
Question

Simple text variable to populate current Illustrator document file name on my Illustrator artboard.

  • March 4, 2024
  • 2 replies
  • 1025 views

I cannot find a script or a function in Illustrator that will create a text box that automatically populates with my current illustrator document file name?

This is very easily done in InDesign by going to the Type menu > Text Variables > Insert Variable > File Name. But this is not available in Illustrator for some reason. Does anyone have any suggestions?

2 replies

Participant
March 4, 2024

Thanks for sharing this @Monika Gause !

I tried copying the script from that post you referenced (see script below) but I keep getting a syntax error (see screenshot) when I try to import it into Illustrator. It’s very likely I’m doing something wrong – I have very limited experience dealing with scripts. 

Script copied from reference post:

// CODE BEGIN
var pointTextRef = app.activeDocument.textFrames.add();
pointTextRef.contents = app.activeDocument.name;
pointTextRef.top = 20;
pointTextRef.left = 10;
// CODE END 

pixxxelschubser
Community Expert
Community Expert
March 4, 2024

Do not save it in Word!

 

Save it with Editor or similar as (plain text) .txt

And then simply rename the extension from .txt to .jsx

kglad
Community Expert
Community Expert
March 4, 2024

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



<"moved from cc desktop">