Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@KevinGutowski
Created April 2, 2019 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KevinGutowski/a81b1f0dea342fb13086f36be9583184 to your computer and use it in GitHub Desktop.
Save KevinGutowski/a81b1f0dea342fb13086f36be9583184 to your computer and use it in GitHub Desktop.
Paste In SVG code
var sketch = require('sketch/dom')
var UI = require('sketch/ui')
var document = sketch.getSelectedDocument()
var page = document.selectedPage
var svgString
UI.getInputFromUser(
"What's your name?",
{
initialValue: 'Appleseed',
},
(err, value) => {
if (err) {
// most likely the user canceled the input
return
}
svgString = value
}
)
const group = sketch.createLayerFromData(svgString, 'svg')
group.parent = page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment