Language Guide

CHAPTER 6
Expressions
AppleScript Properties 159
returns this result if AppleScript’s text delimiters have not been
explicitly changed:
"breadmilkbutter10.45"
For printing or display purposes, it is usually preferable to set the text
delimiters to something that’s easier to read. For example, the script
set AppleScript's text item delimiters to {", "}
{"bread", "milk", "butter", 10.45} as string
returns this result:
"bread, milk, butter, 10.45"
The Text Item Delimiters property also allows you to extract individual names
from a pathname. For example, the script
set AppleScript's text item delimiters to {":"}
get last text item of "Hard Disk:CD Contents:Release Notes"
returns the result "Release Notes".
Once you change the Text Items Delimiters property, it remains set until you
restart your computer. Currently, AppleScript uses only the first delimiter in
the list.
You may want to use an error handler to reset the Text Item Delimiters
property to its former value if an error occurs:
set savedTextItemDelimiters to AppleScript's text item¬
delimiters
try
set AppleScript's text item delimiters to {"**"}
--rest of script...
--finally, reset the text item delimiters:
set AppleScript's text item delimiters to¬
savedTextItemDelimiters