title: Sketch Plugin: How to programmatically make a layer exportable?
body: <p>So, in <a href="https://www.sketchapp.com/" rel="nofollow noreferrer">Sketch</a>, you can mark a layer/group as exportable. </p>
  
  <p><a href="https://i.stack.imgur.com/Rs0Qk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rs0Qk.png" alt="enter image description here"></a></p>
  
  <p>And then the layer/group can be exported as .png/.svg/.pdf etc. I was trying to make a Sketch Plugin recently, where I need to mark a layer/group as exportable from code. A layer in code is represented using <code>MSLayer</code> and group is <code>MSLayerGroup</code>. The sketch documentation is not mature enough yet, so I used <a href="http://stevenygard.com/projects/class-dump/" rel="nofollow noreferrer">ClassDump</a> to extract all the headers that has been used in the app. I have been looking for a method that might seem to do my job, but it has been days and am still out of luck. Can anybody please help me out in this regard?</p>