Adobe 12040118 Using Help - Page 194
Dialogs and console, This script shows how to use the various dialogs alert, prompt
UPC - 718659361808
View all Adobe 12040118 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 194 highlights
Help Using Help Examples Back 194 app.settings.saveSetting("Email Settings", "Render Report Re cipient", toValue); } } Dialogs and console This script shows how to use the various dialogs (alert(), prompt(), confirm()) and how to write to the info palette (write(), writeLn() and clearOutput()). Although this script serves no practical use, these dialogs and info palette prompts are highly useful and should be familiar to all script creators. // Use confirm() to let the user tell us whether he can see the "info" window. // Depending how the user clicks, true or false is returned. if (confirm("Can you see the \"info\" palette?")){ // Start by clearing the information area. clearOutput(); // write and writeLn will write to the info tab with or without a //'newline' // at the end. write("Roses are red,"); writeLn("violets are blue"); write("Sugar is sweet,"); writeLn("and so is Equal."); var reply = prompt( "Did you like my poem?"); if (reply == "yes" || reply == "YES"){ alert("See the info window for a special secret fortune."); // This gets rid of the old writing on the info tab. clearOutput(); w r iteLn("You have a future as a liter ar y cr itic."); } else { alert("Hmm, I'll try once more..."); writeLn writeLn("Roses are red, violets are blue,"); writeLn("I've got some gum, on the sole of my shoe."); } alert("Okay, all done with this test."); } else { // alert() just displays a message in a dialog box. alert("Please make it so you can see the info palette and run this script again"); } Using Help Back 194