Skip to main content
Inspiring
August 7, 2014
Question

$.fileName from ExtendScript

  • August 7, 2014
  • 2 replies
  • 2276 views

I think this one is a bug, maybe introduced with the latest Illustrator CC 2014 update... This is Illustrator CC 2014 running on Windows 7.

I have a simple script like this:


#target Illustrator-18.064

alert($.fileName);

Now it works as expected when executed from the File>Scripts, or executed from inside ExtendScript ToolKit CC. But if I try this:

"C:\ProgramX86\Adobe\Adobe ExtendScript Toolkit CC\ExtendScript Toolkit.exe" -run "C:\pathtoscript\testscript.jsx"


Then it is outputs "3"

I think this used to work, can someone confirm this, please?

I use this in scripts for a "#includepath (new File($.fileName)).parent" clause to include other files, and it doesn't work now!

This topic has been closed for replies.

2 replies

Silly-V
Legend
August 31, 2015

I noticed this issue when using $.fileName to get the script location when using Bridgetalk object to send a script to an application. My thoughts are that in bridgetalk, the script is actually read as a string and is no longer associated with the file from which it came, so maybe the same thing happens when you run it in your command line there.

Silly-V
Legend
November 10, 2015

New update: somehow I missed this all these years, but $.fileName also has the same behavior when a .jsx file is double-clicked to run! I guess I am always either running from ESTK or File / Scripts, that I've never noticed this. I guess this is a bad deal when wanting to rely on the script's path when doing a stand-alone .jsx execution...

$.fileName WORKS$.fileName DOESN'T WORK
Run from ESTKRunning via BridgeTalk
Run from Illustrator Menu > File > ScriptsExecuting from double-click on .jsx icon
CarlosCanto
Community Expert
Community Expert
August 8, 2014

yep, it runs ok with CS5 win7

frax_Author
Inspiring
August 8, 2014

Thanks for checking!