Skip to main content
pixxxelschubser
Community Expert
Community Expert
November 27, 2011
Question

read path (to script directory) under Windows doesn't correct functionate ?

  • November 27, 2011
  • 1 reply
  • 1965 views

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?

This topic has been closed for replies.

1 reply

CarlosCanto
Community Expert
Community Expert
November 28, 2011

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"?

pixxxelschubser
Community Expert
Community Expert
November 28, 2011

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.

CarlosCanto
Community Expert
Community Expert
November 29, 2011

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