Skip to main content
__Alain__
Inspiring
April 4, 2019
Answered

Getting Scriptpath does not work

  • April 4, 2019
  • 1 reply
  • 750 views

Hi

My goal ist to save data into a *.txt-File relative to the Scriptpath. That means I have to find out the Path to the Script.

"app.activeScript" only works when I run the Script within the Adobe ExtendScript Toolkit.

But when I run the Script directly in Illustrator then I get back an "undefinied" Value.

What do I do wrong?

Kind regards

Alain

This topic has been closed for replies.
Correct answer Silly-V

I never knew about app.activeScript... but I believe $.fileName is the way to do it.

* In some contexts such as sending bridgetalk scripts, $.fileName isn't available properly, so this would have to be passed in as a variable from the script that calls the bridgetalk.

1 reply

Silly-V
Silly-VCorrect answer
Legend
April 4, 2019

I never knew about app.activeScript... but I believe $.fileName is the way to do it.

* In some contexts such as sending bridgetalk scripts, $.fileName isn't available properly, so this would have to be passed in as a variable from the script that calls the bridgetalk.

__Alain__
__Alain__Author
Inspiring
April 4, 2019

I tried alert($.filename);

It returns the Value "undefinied".

I guess there is some basic missunderstanding in my brain :-)

__Alain__
__Alain__Author
Inspiring
April 4, 2019

I just found the answer:-)

It's:

alert (File($.fileName).path);