i used sketchtool to run sketchplugin in background progress,but i found the sketchplugin always run errer because
does anyone know why it return null when the screen focus is not in sketch
my sketch version is 52.6
IIRC the reason for this is because [MSDocument currentDocument] is based on what window is top most. If there's no window active, it'll return null. My suggestion is to use the Sketch JS API's Document.getSelectedDocument() method (documentation), which appears to be more reliable.