论坛帮助 |
社区圈子 |
日历事件 |
2024-10-30, 10:12 | #1 | ||
|
|||
正式会员
等级: 一袋长老
|
以下是源码 感谢大神相助!好人一生平安! var dialog = new Window("dialog"); dialog.text = "设置出血"; dialog.orientation = "column"; dialog.alignChildren = ["center","top"]; dialog.spacing = 10; dialog.margins = 16; // GROUP1 // ====== var group1 = dialog.add("group", undefined, {name: "group1"}); group1.orientation = "row"; group1.alignChildren = ["left","center"]; group1.spacing = 10; group1.margins = 0; var edittext = group1.add('edittext {justify: "center",properties: {name: "edittext1"}}'); edittext.text = "单位MM"; edittext.alignment = ["center","top"]; //编辑框获取元素后编辑框内容为空 edittext.onActivate = function() { if (edittext.text == "单位MM") { edittext.text = ""; } }; var exeBtn=dialog.add('group'); exeBtn.alignment='center'; var BtnOk=exeBtn.add('button',undefined,'确认', {name:'ok'}); var doc = app.activeDocument; //赋值当前文档 var artboardRef = doc.artboards; //获取所有画板 var i = doc.artboards.getActiveArtboardIndex(); //获取当前选中的画板索引 //确定按钮被点击后执行 BtnOk.onClick = function() { dialog.close(true); } dialog.show(); |
||
回复时引用此帖 |