read path (to script directory) under Windows doesn't correct functionate ?
Copy link to clipboard
Copied
Hello,
with this Script I can read out the different „path-to-script-variations“. Perfect, example in InDesign or from the ESTK (or under Mac OS).
#target illustrator
var folderAbs = File($.fileName).parent.absoluteURI;
var folderRel = File($.fileName).parent.relativeURI;
var folderSpez = File($.fileName).parent.fsName;
var folderAll = File($.fileName).parent.fullName;
alert(folderAbs + "\n"+ folderRel + "\n"+ folderSpez + "\n" + folderAll);
Under Windows (XP or Vista) I can get the correct result in Illustrator (running the script from ESTK😞
If the script runs directly from Illustrator the result is:
Why this?
How I can get the correct path to the script directory with scripting in Illustrator? Can you help me please?
Explore related tutorials & articles
Copy link to clipboard
Copied
it works fine here, either from the ESTK or from Illustrator. The only way I get the "..../Windows" folder is when I run the script by Double Clicking on it.
How are you running it "directly from Illustrator"?
Copy link to clipboard
Copied
Hi carlos canto,
thank you for your answer.
What operating system do you use?
The script works fine under Mac OS with Illustrator 13.x and 15.x
The script also shows the correct file path in Windows, if the script is executed from the ExtendScript Toolkit (ESTK).
CarlosCanto schrieb:
… How are you running it "directly from Illustrator"?
Only when the script starts out directly from Illustrator: Menu --> File -> Scripts -> (path.jsx), then read out the wrong path. See screenshot in previous post.
The search in the forum did not reveal any useful information.
Copy link to clipboard
Copied
Hi, used Win 7 - CS5 and also tested it with a different Win 7 - CS4 machine. In both cases I got the same results. I added a line to the script to give me the name of the script.
File->Scripts->Paths.jsx
from the ESTK
Double-Clicking on it from the script folder
EDIT: where is you operating system installed, in C:\? if so, I wonder if having Illustrator in D:\ has anything to do with it.
Message was edited by: CarlosCanto
Copy link to clipboard
Copied
Hi carlos canto,
Thank you for testing. Today, I could also test the script on Windows 7.
result:
- it works correct on Windows 7
- it works correct on Mac OS
- it doesn't work under Windows XP (works, if executing by ESTK)
- it doesn't work under Windows Vista (works, if executing by ESTK)
CarlosCanto schrieb:
… where is you operating system installed, in C:\? if so, I wonder if having Illustrator in D:\ has anything to do with it …
Windows was installed on C:
On this test machine Illustrator was not installed in the default directory on C:\program. (D:\…is correct on this PC)

