Skip to main content
Inspiring
April 23, 2024
Question

UXP - How to write file to fixed location?

  • April 23, 2024
  • 1 reply
  • 364 views

 

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

 

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Legend
April 24, 2024

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