macos Homedir

Contributor ,
Dec 13, 2020 Dec 13, 2020

Copy link to clipboard

Copied

Hi,

 

In a CEP project, I have a jsx script that returns a full path name of an AI document.

The js part uses that name to read a related text file (so, for somedoc.ai I want to read somedoc-features.txt)

On the mac, the jsx returns the ~ shorthand for the user's homedir. The cep readfile function cannot handle that. Currently I  am just replacing the tilde with a hardcoded /Users/Somename but I would certainly prefer to get the proper path from the system

TOPICS
Scripting

Views

83

Likes

translate

Translate

Translate

Report

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

correct answers 1 Correct Answer

Adobe Community Professional , Dec 13, 2020 Dec 13, 2020
Try to use this property of the file object: .fsName - It will show your OS's accurate filesystem name which is a full path and may return backslash delimiters for Windows.

Likes

translate

Translate

Translate
Adobe Community Professional ,
Dec 13, 2020 Dec 13, 2020

Copy link to clipboard

Copied

Try to use this property of the file object: .fsName - It will show your OS's accurate filesystem name which is a full path and may return backslash delimiters for Windows.

Likes

translate

Translate

Translate

Report

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
Contributor ,
Dec 16, 2020 Dec 16, 2020

Copy link to clipboard

Copied

Hi,

 

many thanks, I will give it a try later.

BTW, on the windows side cep panels and jsx scripts have different opinions on drive letter and its colon 😞

Likes

translate

Translate

Translate

Report

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