Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL
Help

Part IV: Appendixes > Control Statements Reference - Pg. 474

Part IV: Appendixes Control Statements Reference Considering and ignoring You can force AppleScript to consider or ignore certain characteristics, such as white space or case. You can also use these clauses to consider or ignore responses from applications. When dealing with text, you can consider or ignore: l l l l l l case diacriticals hyphens numeric strings punctuation white space For example: "hello tom" = "hellotom" -- false ignoring white space "hello tom" = "hellotom" -- true end ignoring You can also ignore or consider application responses. For example, you may want to empty the trash but not wait around for a response: tell application "Finder" ignoring application responses empty the trash end ignoring end tell If You usually have two different types of if statements: a simple one and a complex one. The sim- ple if statement usually only has one Boolean expression: if 1 > 0 then return true end if The compound if statement can be one that contains just an else branch or multiple else if branches on top of the main branch. For example: 474