复制画板3.8之前
// MSCanvasActions
var action = doc.actionsController().actionWithName("MSCanvasActions");
// 默认复制artboards中最后一个画板
action.duplicate(nil);
artboards = page.artboards();
复制前,page里的Artboard数组
" 6 (40479CFB-8A05-4C93-9704-384F0345D865)",
" 6+ (F383BFC0-06BA-43F9-9858-2B16ACC4290B)"
复制后,
当选中"6"画板,复制,"6 copy"画板的在artboards数组中紧紧随"6"后:
"
"
"
3.8.3之后
复制画板
doc = context.document;
log("controller :" + doc.actionsController);
var actionController = doc.actionsController();
log("actions :" + actionController.allActions());
action = actionController.actionWithID("MSCanvasActions");
action.duplicate(nil);
可以关注一下下面这些acrion, 支持很多功能。日后开发文档也可能会完善:
log("actions :" + actionController.allActions());
16/6/5 下午9:34:02.469 Scale (Sketch Plugin)[32254]: actions :(
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
""
)
Sketch 3.8.3最新的头文件
自己写的一个插件:https://github.com/sueLan/ArtMold