Re: Replacing a character in a filename?
Re: Replacing a character in a filename?
- Subject: Re: Replacing a character in a filename?
- From: Michelle Steiner <email@hidden>
- Date: Fri, 24 Aug 2001 07:11:30 -0700
On 8/24/01 6:59 AM, T.J. Mahaffey <email@hidden> wrote:
>
on open theFiles
>
set theSpace to " " as text
>
repeat with thisFile in theFiles
>
if name of thisFile contains theSpace then
>
set theSpace to "_" as text
>
end if
>
end repeat
>
end open
>
>
>
I'd like my script to find spaces in a file name and replace them with
>
underscores. Of course, this doesn't work in it's current form. could
>
someone give me a hint, but not a complete script? I need to learn here. ;)
Here ya' go.
--Michelle
broad hint: Use text item delimiters.
Scroll down for more detailed hint.
Detailed hint.
Set text item delimiters to a space; convert text items to a list; set
text item delimiters to an underscore; set the list of text items back to
text.
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------