Re: Replacing a character/word
Re: Replacing a character/word
- Subject: Re: Replacing a character/word
- From: "Domains4Days.com" <email@hidden>
- Date: Tue, 17 Dec 2002 10:43:41 -0800
Thanks for all the help... For what it's worth - I found this basic stuff on
apples site:
http://www.apple.com/applescript/guidebook/sbrt/pgs/sbrt.07.htm
Replacing Characters in a String
The following sub-routine can be used to replace specific characters in a
string. The sub-routine has three passed parameters:
1) the text to alter, 2) to text to search for, 3) the replacement text
set the message_text to ,
"On Tuesday I told you to have the report ready by next Tuesday."
set the message_text to replace_chars(message_text, "Tuesday", "Friday")
--> Returns: "On Friday I told you to have the report ready by next Friday."
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
- - - - -
AppleScript News
--
RevDave
email@hidden
Check out some great Domain Names at:
http://www.domains4days.com
_______________________________________________
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.