hello Thomas, I recorded an Action, using the same steps as you've included in your demo. Then I used the Copy to JavaScript command in Photoshop. Finally I copied and pasted the Photoshop output into the Script Editor. The overall result is shown in this screenshot.
