Photoshop CS3 - dialog panel for current picture (efect preview)

Upload Photoshop Scripts, download Photoshop Scripts, Discussion and Support of Photoshop Scripts

Moderators: Kukurykus, Tom, xbytor

vo.key
Posts: 1
Joined: Sat Jun 25, 2022 5:15 pm

Photoshop CS3 - dialog panel for current picture (efect preview)

Post by vo.key »

Hallo!

I have little problem with jsx script: I dont know, how to create dialog pannel, which has placed two piture windows: first previews current (opened) photos, second displays this same picture, but with apply some from Photoshop filters, for example <activeDocument.activeLayer.applyOceanRipple(8, 15) >
I know, that panel with picture working by <ScriptUI.newImage() > with < „window“.add("image", [bounds],...> syntax.

At first - I dont know, how to open in panel-preview, current opened document (picture).
At second - I need add some „styles“ or „properties“, namely zooming and drag-n-drop/scrolling this picture for focussing to little details, for example zoom to hair/eye (for checking of unwanted grain/dust efect from to much strong sharpen).
Next: How to... button YES must cause, that effect will be pludged and executed, or - button NO must cause, that effect will be cancelled/ignored and script continue to the next steps...

From this all dont work no one (return errrors):

var a1 = ScriptUI.newImage(new File('activeDocument'));
var a1 = ScriptUI.newImage(new File(activeDocument));
var a1 = ScriptUI.newImage(newFile('app.activeDocument'));
var a1 = ScriptUI.newImage(new File(app.activeDocument));
var a1 = ScriptUI.newImage("app.activeDocument");
var a1 = ScriptUI.newImage(app.activeDocument);
var a1 = ScriptUI.newImage("activeDocument");
var a1 = ScriptUI.newImage(activeDocument);
var a1 = ScriptUI.app.activeDocument;
var a1 = app.activeDocument;
var a1 = activeDocument;
var a1 = this.graphics.drawImage(this.image)
var a1 = this.graphics.drawImage(activeDocument)

This open empty dialog panel, but without pictures:

var a1 = ScriptUI.activeDocument;
var a1 = ScriptUI(activeDocument);
var a1 = app.activeDocument.ScriptUI;
var a1 = activeDocument.ScriptUI;


------------------------------
The code:

var dlg = new Window ("dialog", "Two pictures", [200, 260, 990, 560])
var btnPnl = dlg.add('panel', [10,5,750,280], '');
// var a1 = activeDocument.ScriptUI; >>>>> here is problem
var a1 = ScriptUI.newImage(new File('picture-from-this-folder.jpg')); // this works!
var b1 = btnPnl.add("image", [10, 12,360, 262], a1, {style:'button',toggle:true});
var b2 = btnPnl.add("image", [370,12,720,262], a1,{style:'button',toggle:true});
dlg.show()