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

UXP - How to write file to fixed location?

Contributor ,
Apr 23, 2024 Apr 23, 2024

Copy link to clipboard

Copied

 

I need to write log text files to a fixed location without user interaction.

Can this be done? If i'm not mistaking some versions of UXP did not allow this.

 

thanx

 

tm

 

TOPICS
UXP Scripting

Views

111

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
Community Expert ,
Apr 24, 2024 Apr 24, 2024

Copy link to clipboard

Copied

LATEST

Yes, it is possible; there are two solutions.

 

1. Give file access permission in manifest.json and write the file via UXP

In manifest.json, give file access permissions like this.

  "requiredPermissions": {
    "localFileSystem": "fullAccess"
  },

 

The file path is generated by os.homedir() and path.

fs and localFileSystem are used to write and reference files.

 

 

2. Use doScript and write the file via ExtendScript

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