Re: multiple text delimiters
Re: multiple text delimiters
- Subject: Re: multiple text delimiters
- From: Michelle Steiner <email@hidden>
- Date: Tue, 27 Sep 2005 14:51:29 -0700
On Sep 27, 2005, at 2:21 PM, Patrick J. Collins wrote:
Is there a way to set applescripts text delimiters to more than one
character?
You can have a string as delimiters; e.g.,
set applescript's text item delimiters to "abcd"
Like if I wanted to remove all characters "[" "]" "(" and ")" from
a string?
You would have to loop through with each character.
set the target_string to "[this] is (a) (test) (sentence.]"
set the removal_string to {"]", "[", "(", ")"}
repeat with this_delimiter in the removal_string
set AppleScript's text item delimiters to this_delimiter
set the temp_list to the text items of the target_string
set AppleScript's text item delimiters to ""
set the target_string to the temp_list as text
end repeat
target_string
--> "this is a test sentence."
Theoretically, text item delimiters can be a list of strings, but
it's never been implemented to do that.
-- Michelle
--
"Cut the red wire (clip) (turn page) but first...."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden