Copy link to clipboard
Copied
Hello guys. Can i replace "XXX XXX" text with folder name (where i save in test.ai illustrator file).
Is it any jsx for this? I do this all day it will very helpful for me.
Under Windows?
The document must be saved. The text frame must be selected.
Note: Do NOT use spaces in folder names - use underscores or minus signs as separators
Try this snippet as JSX:
// select your XXX XXX textframe, then run this script snippet
// Hint: Do NOT use spaces in folder names - use underscores or minus as separator
var aDoc = app.activeDocument;
var nme = aDoc.path.toString().split("/").reverse();
var aSel = aDoc.selection;
if (aSel[0].typename == "TextFrame") {
aSel[0].c
...
Copy link to clipboard
Copied
Under Windows?
The document must be saved. The text frame must be selected.
Note: Do NOT use spaces in folder names - use underscores or minus signs as separators
Try this snippet as JSX:
// select your XXX XXX textframe, then run this script snippet
// Hint: Do NOT use spaces in folder names - use underscores or minus as separator
var aDoc = app.activeDocument;
var nme = aDoc.path.toString().split("/").reverse();
var aSel = aDoc.selection;
if (aSel[0].typename == "TextFrame") {
aSel[0].contents = nme[0];
}
Untested. Sent from phone
Copy link to clipboard
Copied
Thank you. It works.
But i need two more detail.
1. I need to write " " (space) for my project. It writes "%20" for spaces. Can i fix that.
2. I need to select text object for that. Is it possible i dont need to to select. Because i have 4 of them for one product. And all of name is XXX XXX XXX XXX.
Copy link to clipboard
Copied
Haha.
I was pretty sure the description was completely inadequate.
🙂
The best way: You complete this answered topic by marking the correct answer.
Then open a new topic:
There are other questions that need to be clarified, so a sample file would be very helpful (without confidential data, saved as a PDF with Illustrator editing and attach in the new topic).
You can replace all confidential texts with dummy text and all images with placeholders. The cutting die can also be changed - only the exact same layer structure with similar objects is important!
See you in the new topic.