论坛帮助 |
社区圈子 |
日历事件 |
2022-05-12, 16:32 | #1 | ||
|
|||
java爱好者
等级: 六袋长老
|
#targetengine main // 定义窗体的属性 var data = { title: '低版本不灵', buttons: [{title:'abc'},{title:'dce'},], } //创建窗体 create_window(data); function create_window(data) { var win = new Window('palette', data.title); for (var bi = 0; bi < data.buttons.length; bi++) { add_button_by_title_and_action_text(win,data.buttons[bi].title) } win.titleLayout = {characters: 8, truncate: 'middle'}; win.center(); win.show(); } function add_button_by_title_and_action_text(win,title) { bt = win.add("iconbutton { title: '"+title+"'}") bt.onClick=function(){action_bridge_talk_text(title)} } function action_bridge_talk_text(title) { var bt = new BridgeTalk(); bt.target = "illustrator"; bt.body = "work('info')".replace('info',title); bt.send(); } function work(info) { var text = app.activeDocument.textFrames.add(); text.contents = info; } |
||
2022-05-13, 09:28 | 只看该作者 #3 | ||
|
|||
java爱好者
等级: 六袋长老
|
#targetengine main // 定义窗体的属性 var data = { title: '低版本不灵', buttons: [{title:'abc'},{title:'dce'},], } //创建窗体 create_window(data); function create_window(data) { var win = new Window('palette', data.title); for (var bi = 0; bi < data.buttons.length; bi++) { add_button_by_title_and_action_text(win,data.buttons[bi].title) } win.titleLayout = {characters: 8, truncate: 'middle'}; win.center(); win.show(); } function add_button_by_title_and_action_text(win,title) { bt = win.add("iconbutton { title: '"+title+"'}") bt.onClick=function(){action_bridge_talk_text(title)} } function action_bridge_talk_text(title) { var bt = new BridgeTalk(); bt.target=BridgeTalk.appName+"-"+BridgeTalk.appVersion; bt.body = "work('info')".replace('info',title); bt.send(); } function work(info) { var text = app.activeDocument.textFrames.add(); text.contents = info; } |
||