Re: Removing characters from a string
Re: Removing characters from a string
- Subject: Re: Removing characters from a string
- From: Paul Skinner <email@hidden>
- Date: Tue, 5 Nov 2002 06:30:20 -0500
On Tuesday, November 5, 2002, at 05:29 AM, christian vick wrote:
I don't think we differ on the issue of using TIDs, Paul. I agree
that, if a
script uses TIDs, it should leave them as it finds them.
What means "as it finds them"? Every script has it's own TIDs, so if
you
know what your script is doing it shouldn't be a problem!??
Greetings
Christian Vick
set AppleScript's text item delimiters to ""
set listOfCharacters to characters of "This is a simple sentence."
someHandler()--maybe you want to check for illegal characters...: )
set listOfCharacters to listOfCharacters as text
-->T-h-i-s- -i-s- -a- -s-i-m-p-l-e- -s-e-n-t-e-n-c-e-.
on someHandler()
--do some things that need to change the TIDs but don't reset them.
set AppleScript's text item delimiters to "-"
end someHandler
If you save the someHandler() and later load it into another script it
will make you angry.
You might say 'I will always set the TIDs just before using them! And
so should you.' (that's just what I said) But you will forget. And also
when you try to call a handler as an argument of another handler...
Asciisort(everyFile of EntireContentsOf(choose folder))
...you can't control it. It's also a lot tidier to put all that fuss
inside the handlers and never have to think about it again.
--
Paul Skinner
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.