编程语言/sketch/getSelectedDocument:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
创建页面,内容为“== 引言 == 获取当前选中的 Sketch 文件 {{leftrightflex|<syntaxhighlight lang="javascript"> sketch.getSelectedDocument();</syntaxhighlight>|{{consoleout|<pr…”
 
Kangkk​(留言 | 贡献)
第4行: 第4行:
sketch.getSelectedDocument();</syntaxhighlight>|{{consoleout|<pre>Document {
sketch.getSelectedDocument();</syntaxhighlight>|{{consoleout|<pre>Document {
   type: 'Document',
   type: 'Document',
   id: '54292A9A-9CBB-448F-BD5A-D3822B810F27',
   id: '50D19D42-72D9-4A63-8926-2730F2BA3EB1',
   colorSpace: 'Unmanaged',
   colorSpace: 'sRGB',
   pages:
   pages:
   [ Page {
   [ Page {
       type: 'Page',
       type: 'Page',
       id: '7DECF1F7-3FEF-4157-9F84-D691D82B77DC',
       id: '12A56ACF-C3CE-4030-94FD-D0B6FF08D828',
       frame: [Object],
       frame: [Object],
       name: '360问卷小程序',
       name: '页面 1',
       selected: true,
       selected: true,
       sharedStyleId: null,
       sharedStyleId: null,
第17行: 第17行:
     Page {
     Page {
       type: 'Page',
       type: 'Page',
       id: 'F9714017-55AE-4C7A-B3D4-BAA6C50B71BA',
       id: 'E92B29AC-87FA-4628-95DE-33DBAFB132CC',
       frame: [Object],
       frame: [Object],
       name: '组件',
       name: '控件',
      selected: false,
      sharedStyleId: null,
      layers: [Array] },
    Page {
      type: 'Page',
      id: '26E54325-2F67-4695-A0AC-F5F97F6D874D',
      frame: [Object],
      name: '页面 1',
       selected: false,
       selected: false,
       sharedStyleId: null,
       sharedStyleId: null,
       layers: [Array] } ],
       layers: [Array] } ],
   path: '/Users/kangjian/Downloads/360%E9%97%AE%E5%8D%B7%E5%B0%8F%E7%A8%8B%E5%BA%8F.sketch',
   path: '/Users/kangjian/Downloads/%E8%B5%84%E6%BA%90%E7%BB%84%E4%BB%B6/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86%E6%A8%A1%E6%9D%BF/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86%E6%A8%A1%E6%9D%BF-%E5%BC%80%E5%8F%91%E5%B9%B3%E5%8F%B0.sketch',
   colors: [  ],
   colors: [  ],
   gradients: [  ],
   gradients: [  ],
   swatches: [ ],
   swatches:
  [ Swatch {
      type: 'Swatch',
      name: '新颜色变量-浅蓝色',
      color: '#0daee7ff',
      referencingColor: <MSColor> (r:0.051213 g:0.680423 b:0.905174 a:1.000000) } ],
   sharedLayerStyles:
   sharedLayerStyles:
   [ SharedStyle {
   [ SharedStyle {
       type: 'SharedStyle',
       type: 'SharedStyle',
       id: 'CD1B05C4-0CB8-4359-BD0E-1A718E9DC0FB',
       id: '4378F4AD-1F1B-4B5F-B4C5-09C7DA289A2B',
      styleType: 'Style',
      name: '图标/面/白',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '0E442E4B-E018-47D7-B11B-FD8693B486ED',
      styleType: 'Style',
      name: '按钮/5%',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '74564757-6FD6-439A-9F80-159D1EF28DC0',
      styleType: 'Style',
      name: '颜色/主色',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'A82AB5B0-0D92-4782-B33B-911652904068',
      styleType: 'Style',
      name: '颜色/黑白灰/分割线',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'F2932486-C890-4F47-87FD-B11EDBDC79B5',
      styleType: 'Style',
      name: '卡片',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'A112EA31-1440-46B2-A3AD-C772018B1C78',
      styleType: 'Style',
      name: '颜色/功能色/绿',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'E2950AE7-887F-4272-9379-C288BA5C11BD',
      styleType: 'Style',
      name: '底部按钮浮层背景 个样式',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'FF753B73-B6DE-4C20-BED4-0C2919A87311',
      styleType: 'Style',
      name: '颜色/透明',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '8D65D249-78F4-4992-8D99-D2DD3B09EEB9',
      styleType: 'Style',
      name: '带阴影区块/默认',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '06570FCF-476F-470D-BACD-511925DEC79C',
      styleType: 'Style',
      name: '黑色蒙层',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '94FBD500-F82A-4CF6-A603-1F6C4323A661',
      styleType: 'Style',
      name: '颜色/辅色/蓝1 个样式',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '774BC2F3-D47B-42F5-8891-8639451D0035',
      styleType: 'Style',
      name: '按钮/绿',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '180A0914-8565-4BF8-A299-6016B5A46157',
      styleType: 'Style',
      name: '颜色/小程序背景',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '2CA3638D-7483-4E44-90C8-36302426A584',
      styleType: 'Style',
      name: '大按钮/背景/主要/可操作',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '8301E652-09BA-422C-A0A1-DB4CC0160709',
      styleType: 'Style',
      name: '区块阴影 个样式',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '52DA26CF-50E2-421B-8C5B-56FE1978B1F7',
       styleType: 'Style',
       styleType: 'Style',
       name: '弹框背景',
       name: '标签色/未通过',
       style: [Style] },
       style: [Style] },
     SharedStyle {
     SharedStyle {
       type: 'SharedStyle',
       type: 'SharedStyle',
       id: '1C0F8D16-15BD-48F7-B91E-92E40648E915',
       id: 'D515C7E4-AEC8-4A19-BD82-15C80EE7749F',
       styleType: 'Style',
       styleType: 'Style',
       name: '图标/线/1.5/白/90%',
       name: '标签色/已发布',
       style: [Style] },
       style: [Style] },
     SharedStyle {
     SharedStyle {
       type: 'SharedStyle',
       type: 'SharedStyle',
       id: 'C830F9D3-E6E6-49F4-9724-1D8EC5664663',
       id: '78981D0C-B90D-4A5B-83CC-513908E5753B',
       styleType: 'Style',
       styleType: 'Style',
       name: '颜色/黑白灰/浅灰背景 个样式',
       name: '标签色/待审核',
       style: [Style] },
       style: [Style] },
     SharedStyle {
     SharedStyle {
       type: 'SharedStyle',
       type: 'SharedStyle',
       id: 'F80EB3C7-8B3B-4304-A4C0-DE321A2603A3',
       id: '3FDE0BA5-2833-4F58-A0CE-73FCF6BD64CA',
       styleType: 'Style',
       styleType: 'Style',
       name: '表单/输入框/bdr/默认',
       name: '标签色/已生效',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '45DF172F-F272-490E-BA2B-D0730B30FF04',
      styleType: 'Style',
      name: '颜色/黑白灰/浅灰背景',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '4BB081CE-68C3-4572-8B9A-112DF2083152',
      styleType: 'Style',
      name: '图标/线/1.5/黑/90%',
       style: [Style] } ],
       style: [Style] } ],
   sharedTextStyles:
   sharedTextStyles:
   [ SharedStyle {
   [ SharedStyle {
       type: 'SharedStyle',
       type: 'SharedStyle',
       id: 'EEEA94CB-711C-46F9-B2FB-C587EEEEA781',
       id: '8DAF1F87-6746-41DA-972F-71776E18437F',
      styleType: 'Style',
      name: '15/常规/白',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '5867F3FC-4CDF-4A66-B0C9-1F6375E66A50',
      styleType: 'Style',
      name: '17/中黑/90%',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '92C5C4FB-EEE1-4641-BF35-1B8E29040291',
      styleType: 'Style',
      name: '12/常规/白',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '73F9DF74-6E8C-40F6-8191-FD9F30595B3C',
      styleType: 'Style',
      name: '卡片标题',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'DDB57EB7-9CFB-4DE8-9EF0-962A2DFE0E89',
      styleType: 'Style',
      name: '10/蓝',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '768C3519-D98E-423C-9D5A-5B992AF8781B',
      styleType: 'Style',
      name: '小按钮文字',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '01C1C631-A0A7-467F-BCFC-A02C436AE60A',
      styleType: 'Style',
      name: '说明文本/版权信息',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '4B6047CC-2C57-4B1C-B84F-7123461B6700',
      styleType: 'Style',
      name: '17/黑/90%',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '4D0C7A1C-73FB-48F1-A20A-03C8CE3FBFDA',
      styleType: 'Style',
      name: '14/黑/90%',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'B60517EC-2570-47C2-808F-CA1C59A1F8CF',
      styleType: 'Style',
      name: '大按钮/列表项',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'EE7CB952-CE9E-4DAB-A9EC-8551AA113590',
      styleType: 'Style',
      name: '14/黑/30%',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '94678EB8-4070-4895-AC51-38B6A1237923',
      styleType: 'Style',
      name: 'Title bar 标题',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: '3C665E9D-EBC4-42EA-8403-5E8A56227187',
      styleType: 'Style',
      name: '14/黑/50% 个样式',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'B48A9892-90AE-47E4-9CA1-14BF048E8F5E',
      styleType: 'Style',
      name: '10/黑/30%',
      style: [Style] },
    SharedStyle {
      type: 'SharedStyle',
      id: 'FC20524E-C918-48C2-91DC-4AFA9677C3DC',
       styleType: 'Style',
       styleType: 'Style',
       name: '17/蓝',
       name: '新字符样式-test',
       style: [Style] } ] }
       style: [Style] } ] }
</pre>}}}}
</pre>}}}}

2021年6月27日 (日) 07:31的版本

引言

获取当前选中的 Sketch 文件 模板:Leftrightflex