Hi, I'm running the second half of this script to determine the layout orientation and run a specific action according to image layout. It works, although I would like to run this script when Photoshop opens an image file that is a jpg only. If it opens a psd file, I would like the script not to run. The second half isn't working for me. I either left something out or included something wrong on the second script. Any thoughts are greatly appreciated.
if (/jpg$/i.test(activeDocument.name)) {
var doc = activeDocument;}
if(doc.width.value>doc.height.value){//Landscape
doAction("Landscape", "Photos");
}else{//Portrait
doAction("Portrait", "Photos");
}
if (/jpg$/i.test(activeDocument.name)) {
var doc = activeDocument;}
if(doc.width.value>doc.height.value){//Landscape
doAction("Landscape", "Photos");
}else{//Portrait
doAction("Portrait", "Photos");
}