Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script to put the path of the File in an illustrator document

New Here ,
Apr 27, 2011 Apr 27, 2011

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?

TOPICS
Scripting
1.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Apr 27, 2011 Apr 27, 2011

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…

Translate
Adobe
Guide ,
Apr 27, 2011 Apr 27, 2011

var doc = app.activeDocument; alert(doc.fullName);

Will give you the full path to file…

alert(doc.path);

Will give to parent directory…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2011 Apr 27, 2011

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 27, 2011 Apr 27, 2011

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…

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 27, 2011 Apr 27, 2011
LATEST

Thank you very much! worked perfectly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines