On 5. jan. 2010, at 18.15, Barry Wainwright wrote: This is one of those questions that divides opinion and shouldn't be discussed at 'polite' dinner tables ;-)
Yes... I was in fact half way through writing a response when I saw the initial reply from Luther. Personally I think it's ALWAYS a good idea to EITHER reset them to the state you found them in, or simply set them back to "" which is actually what suits me.
The other thing that I like to do, no matter how simple your script seems, is to wrap an error handler around it, and reset them on error
something like
set TIDs to AppleScript's text item delimiters try set textVar to "Text With Spaces" set AppleScript's text item delimiters to space set itemList to (text items of textVar) as list set AppleScript's text item delimiters to "_" set textVar to (itemList as text) set AppleScript's text item delimiters to TIDs on error -- make sure you reset TID's set AppleScript's text item delimiters to TIDs end try return textVar
That way you will always put them back the way you found them, and avoid alot of headache.
|