Hi! I’m currently working on a small UXP plugin that uses batchPlay to export artboards. Using Alchemist I found out that I can trigger the “Artboards to Files…” command by doing this:
For these dialog windows, I usually fill them in the way I want and click the button for doing what they do. Usually “OK” but it looks like “Run” in this case. I capture the event with the “Listener” in Alchemist. This provides the batchPlay code Then I set the batchPlay options to:
dialogOptions: "display"
This usually opens the dialog window with the fields prefilled with whatever was captured by Listener and transferred to batchPlay.
Haven’t tried this with “Artboards To Files” so don’t know if it works for this, however, this method even lets you insert variables for things in the batchPlay, so it’s proven nicely flexible in a couple of circumstances.
AdobeScriptAutomation Script are usually Extendscript scripts. This is also the case for Artboards to Files. It’s a jsx file (you can find it in the folder Presets/Scripts) that will be called with the batchPlay you posted.
It’s not possible to provide data without modifying the script
I would strongly suggest to rewrite the JSX (Extendscript/ScriptUI) to UXP if you want to use it in an UXP plugin.
I haven’t looked at the code of Artboards to Files yet, but I noticed that it’s SUPER inefficient. It takes so long to execute and does some weird steps in between, where I immediately thought “this could be solved in a better way”.
Since then I always just select the artboards and use Layer > Export as which is way faster. Is there anything I’m missing that Artboards to Files provides but Export as doesn’t. To me this script looks like a leftover from old times
Good point! My reason for using this is that it exports only artboards. With the Photoshop API when you load the layers from the current document there is no way to differentiate them from an artboard or a grouped layer (I may be wrong about this though. If you have an idea, then let me know!)
@tomzag I don’t seem to have an Adobe Photoshop 2021 folder there, however, I did spin up a macOS VM and was able to find it where you initially said. Thanks so much for the help!
@simonhenke Interesting! I didn’t know about this. I’ll definitely look into it. Thanks so much for all of the help!