These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Mac and PC path in same document

MadMich
Registered: Aug 29 2007
Posts: 38
Answered

I have an document script which works well on a Mac (though I wish it wouldn't ask to block everytime!).

var gPageCount = 0
this.importAnFDF("/my server/myfolder/myfile.fdf")

My question is how do I make this same file work on a pc as well as a mac? I understand the difference between a mac path and a pc path but am not sure how to incorporate the two in the same document script.

At the moment my colleagues on PC's have to manually find the file.

Thanks in advance

My Product Information:
Acrobat Pro 8.1.2, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi MaMdMich,

Here is an article from JavaScript Corner on working with file paths in PDFs-
http://www.acrobatusers.com/tutorials/2007/js_file_paths/

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
MadMich
Registered: Aug 29 2007
Posts: 38
Thanks for the input.

I'll check it out in my form, but according to the link I seem to be using the correct compatible path?
MadMich
Registered: Aug 29 2007
Posts: 38
Hi Dimitri,

I've had a look at the path on a pc & mac platforms using the this.path method in the console.The PC path is: /my main server/My server/myfolder/myfile.fdf
The Mac path is: /my server/myfolder/myfile.fdf

If I use the PC path it works for PC users but not Macs and vice versa?

The only difference is the initial 'my main server' on the PC path? Any ideas where I'm going wrong?
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi MaMdMich,

If you can't use a relative path, then all you need is an "if" statement to differentiate between the two platforms.

Use code something like this-

if(app.platform == "MAC")
mypath = "/my server/myfolder/myfile.fdf";
else
mypath = " /my main server/My server/myfolder/myfile.fdf";

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
MadMich
Registered: Aug 29 2007
Posts: 38
Perfect! Your a star.