Copy link to clipboard
Copied
I was able to figure out how to embed the Date and File Name, now im looking to embed where the file is located within my folder structure on the document. is this possible?
var pointTextRef = app.activeDocument.textFrames.add(); pointTextRef.contents = app.activeDocument.fullName.toString(); //pointTextRef.contents = app.activeDocument.path.toString(); pointTextRef.top = -1200; pointTextRef.left = 10;
Using '.toString()' should sort that… You will have to remember to run your script there are no events like document save/close that a script can act upon in this app…
Copy link to clipboard
Copied
var doc = app.activeDocument; alert(doc.fullName);
Will give you the full path to file…
alert(doc.path);
Will give to parent directory…
Copy link to clipboard
Copied
if i use the variable fullName it puts in the word "file" if i use path i get the word "folder" this is much closer than i have been able to get in the past though.
// CODE BEGIN
var pointTextRef = app.activeDocument.textFrames.add();
pointTextRef.contents = app.activeDocument.path;
pointTextRef.top = -1200;
pointTextRef.left = 10;
// CODE END
Edit: P.S. Thank you for your help!
I should add one more question, I want to make a template for Customer Proofs and have the folder name embed automaticly when it is saved, purpose being: when I or another person look at the hard copy of the proof they can find what folder it was saved in, is this possible or do i have to actively run this this script every time i use the template?
Copy link to clipboard
Copied
var pointTextRef = app.activeDocument.textFrames.add(); pointTextRef.contents = app.activeDocument.fullName.toString(); //pointTextRef.contents = app.activeDocument.path.toString(); pointTextRef.top = -1200; pointTextRef.left = 10;
Using '.toString()' should sort that… You will have to remember to run your script there are no events like document save/close that a script can act upon in this app…
Copy link to clipboard
Copied
Thank you very much! worked perfectly.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now