display dialog "Hello World"
Figure 5.2.1 Displays a Dialog
set hello to "Hello World" display dialog "hello" display dialog hello
Explanation: This will create a variable hello with text Hello World. A dialog will be displayed with text hello and not the text of variable hello.
This is because we have mentioned the text in double quotes. If we want Hello World to be printed in dialog, then we need to mention the variable name without double quotes or Hello World in double quotes.
The third line will print contents of hello variable in the dialog.
Figure 5.2.2 Strings in Dialog