Skip to content

Instantly share code, notes, and snippets.

@indiscripts
Created February 2, 2021 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indiscripts/164102dbf5ccd54741f92bca77f6b331 to your computer and use it in GitHub Desktop.
Save indiscripts/164102dbf5ccd54741f92bca77f6b331 to your computer and use it in GitHub Desktop.
Test app.doScript from InDesign's modal state
// Test app.doScript from InDesign's modal state
// - Run this jsx from your Scripts panel and click`Test`
// - Feedback here: https://twitter.com/indiscripts
// ---
(function(w,s,u)
{
const V = "ID " + app.version + " / " + $.os;
w = new Window('dialog',"Test doScript in Modal State");
w.orientation = 'row';
w.add('button',u,"Test").onClick = function()
{
try{ app.doScript("alert('SUCCESS in ' + V)") }
catch(e){ alert("FAILED in " + V + '\r\r' + e) }
};
w.add('button',u,"Quit",{ name:'cancel' });
w.show();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment