Re: Finding and replacing multiple characters
Re: Finding and replacing multiple characters
- Subject: Re: Finding and replacing multiple characters
- From: Michelle Steiner <email@hidden>
- Date: Tue, 8 Jul 2003 16:40:48 -0700
On Tuesday, July 8, 2003, at 04:04 PM, Yannick Brodeur wrote:
I need a script that would edit the names of files and folders in a
chosen directory. The following characters / \ : * ? " < > needs to be
replaced by an underscore.
I found this script, wich works great but only allows to change a
single character into an underscore.
set replace_chars to {"/", "\\", ":", "*", "?", "\"", "<", ">"}
set search_string to "How now / brown : cow * where < are > you >
going?"
repeat with find_char in replace_chars
set text item delimiters to find_char
set search_string to (text items of search_string)
set text item delimiters to "_"
set search_string to search_string as text
end repeat
search_string
--> "How now _ brown _ cow _ where _ are _ you _ going_"
--
Impeach The Son Of A Bush!
_______________________________________________
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.