Cancel or pause an invoked action to allow another action to complete
hey all!
i've been working on seemingly simple script force users check spelling when either save or export indesign document.
so far, i've managed spell checking action invoke before save/export action takes place. allows spell checking dialog popup before save/export dialog.
however, issue i'm facing save/export dialog pops after function runs pop spell checking dialog, user can't check spelling before saving or exporting.
i'm thinking need invoke spell checking action when document hasn't been spell checked, , tell save/export action cancel if spell checking action needs run, can't figure out best way script that.
any suggestions or kicks in right direction appreciated!
code far:
#targetengine "session" main(); function main(){ alert('in progress v12'); var beforesave = app.menuactions.itembyname ( "$id/save" ).addeventlistener ( "beforeinvoke", checkspelling ); beforesaveas = app.menuactions.itembyname ( "$id/save as..." ).addeventlistener ( "beforeinvoke", checkspelling ); beforesaveacopy = app.menuactions.itembyname ( "$id/save copy..." ).addeventlistener ( "beforeinvoke", checkspelling ); beforeexport = app.menuactions.itembyname ( "$id/export..." ).addeventlistener ( "beforeinvoke", checkspelling ); function checkspelling(myevent){ alert('check spelling...'); app.menuactions.itembyname("check spelling...").invoke(); } }
More discussions in InDesign Scripting
adobe
Comments
Post a Comment