Skip to content

Instantly share code, notes, and snippets.

@MarshySwamp
Last active January 4, 2020 23:10
Show Gist options
  • Save MarshySwamp/c008973d6bc99ee48d4837dba419dd8d to your computer and use it in GitHub Desktop.
Save MarshySwamp/c008973d6bc99ee48d4837dba419dd8d to your computer and use it in GitHub Desktop.
Code Snippet: Error Check for Open Document
/* Start Open Document Error Check - Part A: If */
if (app.documents.length > 0) {
/* Main Code Start */
alert('Do something here!');
/* Main Code Finish */
}
/* Finish Open Document Error Check - Part A: If */
/* Start Open Document Error Check - Part B: Else */
else {
alert('A document must be open to use this script!');
}
/* Finish Open Document Error Check - Part B: Else */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment