SketchAPI
SketchAPI copied to clipboard
context.document is null when I listen to 'OpenDocument'.
I want to add a sidebar when I open a document. So I listen to 'OpenDocument'. There is a line in my code: const contentView = context.document.documentWindow().contentView(); But the context.document is null and the context. actionContext.document.documentWindow() is null. So I can not get the contentView. After the document is opened, I run the command in menu and can get the contentView. So what should I do? Should I use another action?
It's a known bug: https://sketchplugins.com/d/24-api-for-opened-document-url/5. We are currently revamping the entire actions architecture so we will look at it at the same time