New to scripting, and docs don't say enough. Can my framing action be done in UXP?

I was excited to read that PS 2021 includes a new scripting tool, UXP. But documentation for it is nowhere near enough for someone who’s never done any scripting before.

I have a set of actions that add frames around my photographs. But, as with all actions, all settings are hard-coded. I have different actions for different sizes of photos, and I still usually have to tweak things to get them just right after I run the actions. So, I want a script where I can enter the parameters first, like frame size as percent of image size, title, copyright notice, and so on, and then click a Go button, and the frame would be added.

The specific steps my action takes for a 4000-pixel-high image are:

  1. Increase canvas size by 8 pixels in frame color
  2. Increase canvas size by 6 pixels in white
  3. Increase canvas size by 170 pixels in frame color
  4. Add 170 pixels to the bottom of the canvas in frame color
  5. Set image resolution to 300 px/inch
  6. Create text layer for title
  7. Position text layer below the image and even with the image’s left edge
  8. Create text layer for copyright notice
  9. Position copyright notice below the title and even with its left edge
  10. Create text layer for caption
    11 Position caption below image and even with the right edge.

Is all of this possible with the current statue of UXP?

I’m afraid I’m going to need a fair amount of hand-holding.

Thank you.

Everything you’ve listed can be done, but you will probably need batchPlay for now. You’ll definitely want to check out @Jarda’s Alchemist plugin (github) to record each step so that you can inspect the results and then parameterize them.

The Watermark 3 plugin by @tomzag does some similar things, so this should give you some confidence that it’s possible.