Skip to main content
Damienned
Inspiring
January 26, 2012
Answered

How to define a windows path?

  • January 26, 2012
  • 1 reply
  • 779 views

I have a dynamic path for mac osx:

var progressbaricon = File(app.path+'/Presets.localized/' + app.locale + '/Scripts/idatabase/Images/For_the_birds/progressbar.png');

Now i want to create the same path for windows, can someone help.

Cheers Daniel

This topic has been closed for replies.
Correct answer Damienned

I've found that you only have to change Presets.localized to Presets to make it work in windows.

var progressbaricon = File(app.path+'/Presets.localized/' + app.locale + '/Scripts/idatabase/Images/For_the_birds/progressbar.png');

Daniel

1 reply

CarlosCanto
Community Expert
Community Expert
January 26, 2012

this is what I get on Windows

$.writeln(app.path); // /c/Program%20Files/Adobe/Adobe%20Illustrator%20CS5

$.writeln(app.locale); // en_US

Inspiring
January 26, 2012

$.writeln( decodeURI( $.fileName ) ); returns me on OSX

/Applications/Adobe Illustrator CS5/Presets.localized/en_GB/Scripts/Muppet Scripts/Find_Me.jsx

without the decode

/Applications/Adobe%20Illustrator%20CS5/Presets.localized/en_GB/Scripts/Muppet%20Scripts/Find_Me.jsx

It should get you a flexible path to your script from which you can set the rest to your *.png

Damienned
DamiennedAuthorCorrect answer
Inspiring
January 28, 2012

I've found that you only have to change Presets.localized to Presets to make it work in windows.

var progressbaricon = File(app.path+'/Presets.localized/' + app.locale + '/Scripts/idatabase/Images/For_the_birds/progressbar.png');

Daniel