Skip navigation
Mr Clint Eastwood
Currently Being Moderated

Get source path of .ai file`?

Sep 7, 2012 4:42 AM

Hi!


Have searched but i cant find a good way of retrieving the source path of the current .AI file. Is it possible?

 

IE: If i am working with a file in C:\adobe\Illustrator\beautifulfile.ai i want a function that retrieve C:\adobe\Illustrator\

 

// Clint

 
Replies
  • Currently Being Moderated
    Sep 7, 2012 7:55 AM   in reply to Mr Clint Eastwood

    alert(app.activeDocument.path);

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 7, 2012 7:56 AM   in reply to Mr Clint Eastwood

    Well if the file is saved some wher on system…

     

    alert( app.activeDocument.fullName.fsName );
    
     
    |
    Mark as:
  • Currently Being Moderated
    Sep 10, 2012 3:43 AM   in reply to Mr Clint Eastwood

    alert( decodeURI( app.activeDocument.fullName.parent) );

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 15, 2012 4:41 PM   in reply to Mr Clint Eastwood

    your example C:\adobe\Illustrator\beautifulfile.ai

     

     

    Well, try this:

    alert(app.activeDocument.fullName.parent.fsName);  // = C:\adobe\Illustrator
     
    

     

    or (if last backslash is really needed):

    alert(app.activeDocument.fullName.parent.fsName + "\u005c");  // = C:\adobe\Illustrator\
     
    
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points