Reputation: 3046
I've managed to isolate the json
structure of a specific Symbol by looking into the new Sketch open format file.
How can I now re-import it into a new Sketch file with a simple drag&drop? It seems like Sketch doesn't accept the json
file as an input.
I've been trying to have a look at how some other apps like Craft and Lingo handle this, but I wasn't unable to inspect their source code.
Upvotes: 2
Views: 1530
Reputation: 31
A good place to start would be to check out the official documentation from Sketch.
https://developer.sketch.com/reference/api/
You would have to make a script that takes the JSON and creates a new symbol and adds this to a page.
Create a new symbol master: https://developer.sketch.com/reference/api/#create-a-new-symbol-master
Add it to a page https://developer.sketch.com/reference/api/#page
Also, this plugin describes already a bit how you could do the drag and drop behavior. https://github.com/romannurik/Sketch-Stickers
Further a good place to start for plugins is: https://skpm.io/
For debugging I would recommend: https://github.com/skpm/sketch-dev-tools
Upvotes: 1