Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Expert ,
Nov 27, 2011 Nov 27, 2011

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😞

PathToScriptFromESTK.png

If the script runs directly from Illustrator the result is:

PathToScriptFromIllustrator.png

Why this?

How I can get the correct path to the script directory with scripting in Illustrator? Can you help me please?

TOPICS
Scripting
1.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Nov 27, 2011 Nov 27, 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"?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2011 Nov 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 28, 2011 Nov 28, 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

pathsInsideIlustrator.gif

from the ESTK

pathsFromESTK.gif

Double-Clicking on it from the script folder

pathsDoubleClicking.gif

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 29, 2011 Nov 29, 2011
LATEST

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)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines