Sketch 插件-复制画板

复制画板3.8之前

// MSCanvasActions
var action = doc.actionsController().actionWithName("MSCanvasActions");
// 默认复制artboards中最后一个画板
action.duplicate(nil);
artboards = page.artboards();
复制前,page里的Artboard数组
"<MSArtboardGroup: 0x7fc4a0f51660> 6 (40479CFB-8A05-4C93-9704-384F0345D865)",
"<MSArtboardGroup: 0x7fc4a0f51780> 6+ (F383BFC0-06BA-43F9-9858-2B16ACC4290B)"
复制后,

当选中"6"画板,复制,"6 copy"画板的在artboards数组中紧紧随"6"后:
"<MSArtboardGroup: 0x7fc4a0f51660> 6 (40479CFB-8A05-4C93-9704-384F0345D865)",
"<MSArtboardGroup: 0x7fc4a5a017d0> 6 copy (F2BB6C08-12FE-4C10-8F67-1A3E540B69C1)",
"<MSArtboardGroup: 0x7fc4a0f51780> 6+ (F383BFC0-06BA-43F9-9858-2B16ACC4290B)"

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 :(
    "<MSInsertSliceAction: 0x7f94a700fab0>",  
    "<MSTogglePixelGridAction: 0x7f94a70174b0>",
    "<MSAddFillAction: 0x7f94a7018700>",
    "<MSAlignLayersCenterAction: 0x7f94a70085b0>", 
    "<MSZoomAction: 0x7f94a7003790>", 
    "<MSExportAction: 0x7f94a7017790>",
    "<MSConvertToOutlinesAction: 0x7f94a70160a0>",
    "<MSAlignCenterAction: 0x7f94a7010430>",  
    "<MSReplaceImageAction: 0x7f94a7014830>",
    "<MSTriangleShapeAction: 0x7f94a700ffb0>",
    "<MSRotateAction: 0x7f94a7015df0>",
    "<MSLockLayerAction: 0x7f94a7017d40>",
    "<MSFlipHorizontalAction: 0x7f94a70116c0>",
    "<MSInsertImageAction: 0x7f94a700f790>",
    "<MSHideLayerAction: 0x7f94a7017a60>",
    "<MSAddShadowAction: 0x7f94a7009cd0>",
    "<MSBackToInstanceAction: 0x7f94a701e7b0>",
    "<MSUnderlineAction: 0x7f94a700fae0>",
    "<MSInsertLineAction: 0x7f94a700ee60>",
    "<MSAlignLeftAction: 0x7f94a7005870>",
    "<MSSelectAllArtboardsAction: 0x7f94a701ed70>",
    "<MSShowFillOptionsAction: 0x7f94a7015440>",
    "<MSTogglePixelLinesAction: 0x7f94a701f8f0>",
    "<MSToggleLayerHighlightAction: 0x7f94a701feb0>",
    "<MSMoveToFrontAction: 0x7f94a7013f60>",
    "<MSHideAllGridsAndLayoutsAction: 0x7f94a70138c0>",
    "<MSImageOriginalSizeAction: 0x7f94a7007e30>",
    "<MSAddInnerShadowAction: 0x7f94a70190f0>",
    "<MSCloudAction: 0x7f94a701d8f0>",
    "<MSStarShapeAction: 0x7f94a7011970>",
    "<MSPencilAction: 0x7f94a700f180>",
    "<MSIgnoreClippingMaskAction: 0x7f94a7006c40>",
    "<MSInsertTextLayerAction: 0x7f94a700f430>",
    "<MSAlignLayersMiddleAction: 0x7f94a7008a70>",
    "<MSAddBorderAction: 0x7f94a70099c0>",
    "<MSCreateSymbolAction: 0x7f94a7018b00>",
    "<MSClippingMaskAction: 0x7f94a7012180>",
    "<MSToggleGridAction: 0x7f94a7016ef0>",
    "<MSViewMenuAction: 0x7f94a7016930>",
    "<MSBooleanMenuAction: 0x7f94a7010030>",
    "<MSDifferenceAction: 0x7f94a70135a0>",
    "<MSReduceImageSizeAction: 0x7f94a70079c0>",
    "<MSBaseAlignLayersAction: 0x7f94a70081d0>",
    "<MSResizeArtboardToFitAction: 0x7f94a701e2b0>",
    "<MSSpiralShapeAction: 0x7f94a7013940>",
    "<MSToggleBorderAction: 0x7f94a7011250>",
    "<MSToggleArtboardShadowAction: 0x7f94a701f330>",
    "<MSUnionAction: 0x7f94a7012d10>",
    "<MSRoundedRectangleShapeAction: 0x7f94a7010c70>",
    "<MSOvalShapeAction: 0x7f94a700f960>",
    "<MSCanvasActions: 0x7f94a391c760>",
    "<MSNineSliceAction: 0x7f94a70150a0>",
    "<MSToggleFillAction: 0x7f94a7013010>",
    "<MSPolygonShapeAction: 0x7f94a7011690>",
    "<MSSmartRotateAction: 0x7f94a7015860>",
    "<MSEditAction: 0x7f94a7015b40>",
    "<MSTransformAction: 0x7f94a7014dc0>",
    "<MSInsertArrowAction: 0x7f94a7010400>",
    "<MSToggleAlignmentGuidesAction: 0x7f94a701f610>",
    "<MSToggleRulersAction: 0x7f94a7016c10>",
    "<MSRevealInLayerListAction: 0x7f94a70092a0>",
    "<MSMakeUppercaseAction: 0x7f94a70054f0>",
    "<MSInsertMenuAction: 0x7f94a700ec00>",
    "<MSAlignJustifiedAction: 0x7f94a7010ca0>",
    "<MSShowBorderOptionsAction: 0x7f94a701d070>",
    "<MSToggleLayoutAction: 0x7f94a70171d0>",
    "<MSToggleSelectionAction: 0x7f94a701fbd0>",
    "<MSAddExportFormatAction: 0x7f94a701f050>",
    "<MSScaleAction: 0x7f94a7016380>",
    "<MSMoveForwardAction: 0x7f94a7011220>",
    "<MSShapeAction: 0x7f94a70106e0>",
    "<MSAlignLayersLeftAction: 0x7f94a7015b70>",
    "<MSRemoveUnusedStylesAction: 0x7f94a701d350>",
    "<MSSubtractAction: 0x7f94a7012fe0>",
    "<MSJoinAction: 0x7f94a7007670>",
    "<MSInsertArtboardAction: 0x7f94a700fd90>",
    "<MSToolsMenuAction: 0x7f94a7014ae0>",
    "<MSFlattenAction: 0x7f94a70128d0>",
    "<MSAlignLayersBottomAction: 0x7f94a7016f20>",
    "<MSIntersectAction: 0x7f94a70132c0>",
    "<MSPrintAction: 0x7f94a3916c20>",
    "<MSBaseStyleAction: 0x7f94a7009640>",
    "<MSInsertVectorAction: 0x7f94a700eea0>",
    "<MSCollapseAllGroupsAction: 0x7f94a70177c0>",
    "<MSCreateSharedStyleAction: 0x7f94a7018de0>",
    "<MSMakeGridAction: 0x7f94a7005040>",
    "<MSDistributeVerticallyAction: 0x7f94a7014800>",
    "<MSTextOnPathAction: 0x7f94a7007000>",
    "<MSTogglePresentationModeAction: 0x7f94a7013880>",
    "<MSFlattenSelectionAction: 0x7f94a70183f0>",
    "<MSInsertSymbolAction: 0x7f94a7011c50>",
    "<MSAlignLayersTopAction: 0x7f94a7008930>",
    "<MSUngroupAction: 0x7f94a70125f0>",
    "<MSAlignLayersRightAction: 0x7f94a70163b0>",
    "<MSInsertSharedTextAction: 0x7f94a7012150>",
    "<MSRectangleShapeAction: 0x7f94a7010990>",
    "<MSClosePathAction: 0x7f94a7012900>",
    "<MSDetachSybolInstancesAction: 0x7f94a701ea90>",
    "<MSSyncSharedStyleAction: 0x7f94a70190c0>",
    "<MSMakeLowercaseAction: 0x7f94a700f1b0>",
    "<MSRoundToPixelAction: 0x7f94a70186d0>",
    "<MSAutoExpandGroupsAction: 0x7f94a7008ec0>",
    "<MSMoveBackwardAction: 0x7f94a70112d0>",
    "<MSSaveAsTemplateAction: 0x7f94a70060c0>",
    "<MSMirrorAction: 0x7f94a701d630>",
    "<MSResetSharedStyleAction: 0x7f94a70193a0>",
    "<MSMaskWithShapeAction: 0x7f94a7016650>",
    "<MSResetBooleanAction: 0x7f94a7015380>",
    "<MSClippingMaskModeAction: 0x7f94a70068f0>",
    "<MSGroupAction: 0x7f94a7012320>",
    "<MSFlipVerticalAction: 0x7f94a7006510>",
    "<MSScissorsAction: 0x7f94a7012a10>",
    "<MSAlignRightAction: 0x7f94a7005d00>",
    "<MSMoveToBackAction: 0x7f94a7014240>",
    "<MSDistributeHorizontallyAction: 0x7f94a7014520>",
    "<MSSplitAction: 0x7f94a70077d0>"
)

Sketch 3.8.3最新的头文件

自己写的一个插件:https://github.com/sueLan/ArtMold

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,290评论 6 491
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,107评论 2 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 156,872评论 0 347
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,415评论 1 283
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,453评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,784评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,927评论 3 406
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,691评论 0 266
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,137评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,472评论 2 326
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,622评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,289评论 4 329
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,887评论 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,741评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,977评论 1 265
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,316评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,490评论 2 348

推荐阅读更多精彩内容