The TL;DR is I’d like to be able to save a new, dynamically generated Photoshop document on the user’s local disk in a specific location using either BatchPlay or the Storage API, WITHOUT prompting the user to save the document.
(I’ll already have permissions to the folder in question via a persistent token, so there’s no shenanigans going on here.).
I’ve tried a few things, but can’t quite get there. Any ideas?
- The general idea is that a PSD/PSB will be dynamically created for the user based external inputs, then saved to their local disk while they do work. Later, that saved file will be synced to the cloud for the user’s later access and storage.
- Again, I’ll already have a persistent token for the parent folder, (or I will ask for permission to access the parent folder before the attempted save, if not) so I should theoretically be able to save this without additional user interaction.
- folder.createFile doesn’t seem to have a method for taking the current active document (or any open document) and making a file that’s appropriate for saving. (Perhaps I need to get the binary data of the PSD/PSB and use this API accordingly?)
- BatchPlay complains when I try to save manually, because (of course) it needs a file access token. Is it possible to provide an existing token for the parent folder to accomplish this?
- Here’s the specific BatchPlay command I was using: (saveFile is a string, indicating where on the local drive I want to save the file)
Happy to provide more code examples or clarify anything that’s confusing!