DekGenius.com
Team LiB   Previous Section   Next Section
ignoring [but considering] end [ignoring]

Syntax

ignoring application responses
end ignoring

Description

You can use this statement block to control string comparisons. The ignoring statement is used with application responses to disregard any responses from the apps that receive the script commands:

ignoring application responses...end ignoring

The following AppleScript constants are the parameters to the ignoring statement. They are all considered by default:

  • application response

  • case, as in upper- or lowercase

  • diacritical, like the two dots in ü.

  • expansion; if ignored, then æ, Æ , œ, and Œ are equal to ae, AE, oe, and OE, respectively. These letters are by default not equal to each other.

  • hyphen, as in "-"

  • punctuation; these marks are ignored by the statement ignoring punctuation: . , ? : ; ! \ ' " `

  • white space

Examples

This code shows how to use ignoring...end ignoring. Believe it or not, the code:

"j'u-n,k t?'ext" is equal to "junk text"

returns true, because the enclosing ignoring block tells AppleScript to ignore punctuation and hyphens when making the string comparison:

ignoring punctuation and hyphens but considering case
   return ("j'u-n,k t?'ext" is equal to "junk text") (*returns true 
because punctuation is ignored in the comparison *)
end ignoring

If you want to ignore more than one constant, just separate them with the and operator:

ignoring punctuation and white space and hyphens and expansion.

You can also use the but considering parameter followed by one of the specified constants (e.g., hyphen, white space) to ignore some elements but consider others:

ignoring punctuation but considering white space
    Team LiB   Previous Section   Next Section