Copy link to clipboard
Copied
full :
1.open file--a.psd
2.build spot channel---channel name :extral_mask
3.Fill color----Balck
4.canvas size 1cm(Relative,canvas extension color:white,Right)
5.slect spot channel---channel name :extral_mask,build mask
6.inverse
7.del spot channel---channel name :extral_mask
8.open left mark file
9.select_all,copy,close left mark file
10.paste to a.psd
11.layer Flatten image
12.Fill color----Balck
13.build spot channel---channel name :extral_mask
14.canvas size 1cm(Relative,canvas extension color:white,Left)
15.slect spot channel---channel name :extral_mask,build mask
16.inverse
17.del spot channel---channel name :extral_mask
18.open left mark file
19.select_all,copy,close left mark file
20.paste to a.psd
21.layer Flatten image
2-21 code can get by ScriptingListenerJS.log
i want 2-12 javascript code build scriptui
a.if select with or witout mark and only slect right mark..run 2-11
b.if select with or witout mark and only slect left mark..run 12-21
c.if select with or witout mark and slect left mark and slect right mark..run 2-21
d.if don't with or witout mark,slect left mark and slect right mark don't active
I)select save as jpeg
II)select save as Tiff
I and II can't select at the same time
#target photoshop
if (app.documents.length > 0) {
var dlg = new Window("dialog", "Auto mark", [0,0,345,785]);
dlg.f6=dlg.add("checkbox",[15,243,46,105],"With or without Mark", { value: false});
//***************************************************************************************************
dlg.f3=dlg.add("panel",[15,276,330,485],"Mark type");
dlg.f3.add("statictext",[15,15,86,35],"Mark Width:");
dlg.mk1=dlg.f3.add("edittext", [92,15,116,35]);
dlg.f3.mk1Text = dlg.f3.add("statictext", [122,15,146,35], "mm");
dlg.Lmk=dlg.f3.add("checkbox",[15,50,86,35],"Choose Left Mark");
dlg.Lbtn=dlg.f3.add("button", [172,50,111,35],"Left Mark folder",{name:"open"});
dlg.L= dlg.f3.add("edittext", [15,85,290,35]);//display slected folder
dlg.Rmk=dlg.f3.add("checkbox",[15,120,86,35],"Choose right Mark");
dlg.Rbtn=dlg.f3.add("button", [172,120,111,35],"Right Mark Folder",{name:"open"});
dlg.R= dlg.f3.add("edittext", [15,160,290,35]);//display slected folder
//***************************************************************************************************
dlg.f4=dlg.add("panel",[15,511,330,715],"Save file type");
dlg.f4.add("checkbox",[15,25,46,45],"Savs as JPEG",);
dlg.f4.add("statictext",[15,45,106,66],"File name prefix:");
dlg.jprefix=dlg.f4.add("edittext", [108,45,290,66]);
dlg.f4.add("statictext",[15,65,46,90],"Qualityļ¼");
dlg.Quality=dlg.f4.add("edittext", [51,65,111,90]);
dlg.f4.QualityText = dlg.f4.add("statictext", [116,65,300,90], "value is 1~12");
dlg.f4.add("checkbox",[15,110,46,130],"Savs as TIFF",);
dlg.f4.add("statictext",[15,135,106,151],"File name prefix:");
dlg.Tprefix=dlg.f4.add("edittext", [108,135,290,151]);
//***************************************************************************************************
dlg.buildBtn = dlg.add("button", [80,740,153,730], "OK", {name:"ok"});
dlg.cancelBtn = dlg.add("button", [195,740,275,730], "Cancel", {name:"cancel"});
//***************************************************************************************************
dlg.center();
var myReturn = dlg.show ();
if (myReturn == 1) {
var myDocument = app.activeDocument;
//===atuo mark====
//*****I don't know how to write here.****
a.if select with or witout mark and only slect right mark..run 2-11
b.if select with or witout mark and only slect left mark..run 12-21
c.if select with or witout mark and slect left mark and slect right mark..run 2-21
d.if don't with or witout mark,slect left mark and slect right mark don't active
//--save as jpeg or save as tiff---------
//*****I don't know how to write here.****
I)select save as jpeg
II)select save as Tiff
I and II can't select at the same time
}
pls help me
Copy link to clipboard
Copied
Moving to Photoshop Scriptingā
Copy link to clipboard
Copied
ScriptUI is is for Scripts Dialog windows. Scriptlistener code is like actions hard coded Photoshop steps. Step, step, step, no logic.
You could record two actions 2-11 and 20-21. and use doaction however scriptlistener code would hand all code in one file. From your Dialog you will need to use some DOM code to set your save options and output filenames. You start by looking at the sample javascript scripts in the sdk.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now