I'm a newer about sketch plugin and try to write a plugin to export the selected layer to json file. In this process, I meet many problems and ask for your help.
eg: when i run my code with the "Plugins->Run script"， I could use the api toJSON() and i get the json information.
but when i run my code in 'Sketch DevTools', then has the wrong message "
layer.toJSON is undefined