• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

248

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

Valorous Hero , 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.

Votes

Translate

Translate
Adobe
Valorous Hero ,
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.

Votes

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

LATEST

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 😞

Votes

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