I have hundreds pano photos. They have two files to merge. I use Photomerge which works very well. It is very annoy for me to execute Photomerge manually. I read about plugin and script. I created a simple pluging with Javascript. I managed to open a folder to open two photos to merge. I realized that Action will not record Photomerge, so I created my own action to merge them. I used Align and Blend functions. The script opens two files and call the action. It creates problems.
First thing, the action works perfect when I put two files in Photoshop and run the action every time. When the script calls the action, it will stuck at an alert message âThe command âAuto-Blend Layersâ is not currently available.â I wrote a pause between Align and Blend and noticed that Photoshopâs document will not perform final align layers before call blend. It tried to select both layers but the document is still in single layer. I believe the action performs too quick. So, I change Playback Options: Accelerated to Step by Step or Pause for 2 seconds. Few times, it works but most time Photoshop crashes.
I got this message from Photoshop log. First two command messages which are my script wrote message. Last two command messages from Photoshop which it doesnât helpful.
[2025-04-27_18-11-23][26616][Default] [console] R1-06717-0000.JPG
[2025-04-27_18-11-24][26616][Default] [console] R1-06717-0001.JPG
[2025-04-27_18-11-25][14508][Info] [console] Zip not found at C:\Projects\Auto Pano\sample\R1-06717-0000_JPG.c2paws
[2025-04-27_18-11-25][14508][Info] [console] Zip not found at C:\Projects\Auto Pano\sample\R1-06717-0001_JPG.c2paws
My code is here:
async function targetFunction() {
const fs = require('uxp').storage.localFileSystem;
var folder = await fs.getFolder();
var entries = await folder.getEntries();
for (const entry of entries) {
if (entry.isFile) {
const content = await entry.read({ encoding: 'utf-8' });
console.log(entry.name);
await require('photoshop').app.open(entry);
}
}
var name = "Custom";
var action = "Manual Pano 08";
playAction(name, action);
}
async function playAction(setName, actionName) {
//function playAction(setName, actionName) {
let setFound = false;
let actionFound = false;
const actionSets = require('photoshop').app.actionTree;
// check for action set name to exist
for (let i = 0; i < actionSets.length; i++) {
if (actionSets[i].name == setName) { var setToPlay = actionSets[i]; setFound = true; }
}
//check for action name to exist
if (setFound == true) {
for (let i = 0; i < setToPlay.actions.length; i++) {
if (setToPlay.actions[i].name == actionName) {
var actionToPlay = setToPlay.actions[i];
actionFound = true;
}
}
}
//play if action set/action both exist
if (setFound == true && actionFound == true) { await actionToPlay.play(); }
}