Last active
January 4, 2020 23:10
-
-
Save MarshySwamp/c008973d6bc99ee48d4837dba419dd8d to your computer and use it in GitHub Desktop.
Code Snippet: Error Check for Open Document
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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