print file name AND the path.

Current action, File Name Stamper, does only the file name. I also need the path. I would like the name and path to be updated automatically when either the file name or path is changed, but that's not critical. I want something that saves file name and path just like is now done in Excel and Word.

Need to modify the action using java script.


Bill Hewes


2 Answers

To get the file path with javascript:

this.path

to get the file name with javascript:

this.path.split("/")[this.path.split("/").length-1]

to get the file name (minus the file extenstion):

this.path.split("/")[this.path.split("/").length-1].replace(/.pdf/,"")


David Dagley   

As noted one can separate the file name from the file path.

There is also the URL property and the documentFileName property.

this.path;

/File-na1-03/userdata2$/[userid]/My Documents/Adobe/Acrobat/Acrobat11/js_api_reference.pdf

this.URL;

file://///File-na1-03/userdata2$/georg581/My%20Documents/Adobe/Acrobat/Acrobat11/js_api_reference.pdf

this.documentFileName;

js_api_reference.pdf


George Kaiser   


Please specify a reason: