How can I execute excel file just created

Hi, I always thank you for all your advice.

The thing is, In my project, I’m creating excel file by SheetJS and fileEntry.write() function.
And I have to execute excel file right after being created just like native sheetJS does.

but due to the security problem, it seems not easy(or impossible…).
Is there any way that I can do this?

thank you in advance.

Hi,
you could try to create your *.xlsx in the “Plugin Data Folder” of your plugin.
This folder does not require a token or open dialog for read/write access.
You can get this folder via:

require('uxp').storage.localFileSystem.getDataFolder();

Under Windows the folder content will be stored somewhere here:
C:\Users\<username>\AppData\Roaming\Adobe\UXP\PluginsStorage\PHSP\22\Developer\<PluginName>\PluginData

Best Regards
Jens

1 Like

Actually, the excel file should be saved in the user’s document folder.
Thank you for reply!

If you want to write outside of the plugin storage you have two options.

  1. First show a dialog where the user can then select the location to write the file to. This gives you some rights outside of the plugin storage.
    Storage module · Adobe XD Plugin Reference

  2. Build an app next to your photoshop plugin where you communicate with. So for example you would build a node.js app that would run locally. Than using an XMLHTTPRequest or Websock to communicate with that app to do the writing outside of the security context.
    https://www.adobe.io/photoshop/uxp/uxp/reference-js/Global%20Members/Data%20Transfers/XMLHttpRequest/

1 Like