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?
More details:
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?
Yeah, so saveFile will need to be either a session token or a persistent token, not the physical path. Until you get that, batchPlay is going to complain.
createFile won’t actually put a file on disk until you write something to it. As such, you can just call createFile, and then generate the persistent token from that file. Then pass it to batchPlay.