Created
April 2, 2019 02:44
-
-
Save KevinGutowski/a81b1f0dea342fb13086f36be9583184 to your computer and use it in GitHub Desktop.
Paste In SVG code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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