Folder tokens and Windows' system paths

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

undavide

Folder tokens and Windows' system paths

Post by undavide »

Hi,
I'm writing a Photoshop Add-ons installer script (somehow in the track of what xbytor's done with xtools installer).
I'm quite happy with the results so far, but I'm stuck when it comes to some Windows paths.
According to the HTML Panels documentation, the two paths where panels belong are:

Code: Select allSystem:
"C:\Program Files (x86)\Common Files\Adobe\CEP\extensions"
User:
"C:\Users\[your user name]\AppData\Roaming\Adobe\CEP\extensions"

As far as I can tell from my Mac setup, I can use "Folder.commonFiles" to get the System path.
I'm short of ideas for the User one, but something like:

Code: Select allvar user = $.getenv("USERNAME");
var panelsPath = "/Users/" + user + "/Roaming/Adobe/CEP/extensions";

I'm not expert on Windows stuff so I wonder whether the panelsPath as it's been build might fail on localized OSes (in other terms: is "Roaming" the same in, say, asian languages, Swedish, German...?)

Thank you for any suggestion!

Davide Barranca
xbytor

Folder tokens and Windows' system paths

Post by xbytor »

I don't have my Mac handy, but I can tell you that user settings are in ~/Library which you probably won't see from Finder.
There is a setting somewhere to make Library and a couple of other folders visible in Finder.
undavide

Folder tokens and Windows' system paths

Post by undavide »

Hi xbytor,
thanks for replying.
I'm afraid I didn't explain properly - actually I'm worried by Windows paths i.e. C:\Users\[your user name]\AppData\Roaming\ etc.
I thought to get the username via $.getenv and build the path with Roaming - yet I don't know if on Windows the Roaming folder is translated on different locales or not.
In your experience, is it safe to build paths this way?
Thank you,

Davide
xbytor

Folder tokens and Windows' system paths

Post by xbytor »

Sorry I misunderstood the question.

Folder.userData should be that path that you're looking for. It's where put my log files and xml settings files.
The Adobe folder there contains a lot of stuff including the CEP folder.
undavide

Folder tokens and Windows' system paths

Post by undavide »

Thank you, I was checking userData but the ESTK doc says it points to:

Code: Select allC:\Documents and Settings\username\Application Data

whereas I would have to get:
Code: Select allC:\Users\<username>\AppData\Roaming\Adobe\CEP\extensions\

I've had the chance to try on a virtualized Windows and the console log for Folder.appData says:

Code: Select all~/AppData/Roaming

So I guess the doc is wrong (~ is the user folder, correct?) and you're right
Thank you for the help!

Davide
xbytor

Folder tokens and Windows' system paths

Post by xbytor »

the doc is wrong (~ is the user folder, correct?) and you're right

This time, it seems so. And, yes, ~/ is the user's homer folder.
There was a time many revs ago when the folder properties of the class Folder would mysteriously change from rev to rev.
It looks like the current set is stable and somewhat complete even if they don't match the docs.
IIRC, the Application Data version was XP (or Vista) but was changed by MS as part of the next OS upgrade, so it seems
that the ESTK docs were never updated.