kevgski I don't think the problem is that the actions aren't firing, it's about the actionContext
not containing the corresponding document
I made a tiny test plugin and the context seems to contain the document
manifest.json
{
"author" : "",
"commands" : [
{
"script" : "script.js",
"handlers" : {
"actions" : {
"OpenDocument":"onOpenDocument"
}
}
}
],
"menu" : {
"title" : "opendoc",
"items" : [
"com.bohemiancoding.sketch.runscriptidentifier"
]
},
"identifier" : "com.example.sketch.c0e6fa79-c868-4537-9b3b-a991789efdb5",
"version" : "1.0",
"description" : "",
"authorEmail" : "",
"name" : "opendoc"
}
script.js
function onOpenDocument(context){
log(context.actionContext);
}
is printing
{
document = "<MSDocument: 0x7fc15199fd40>";
selection = (
);
}
when I'm opening a document.
Can you test this code to check it's not some other issue? @arblackman