Re: Replacing characters in filenames
Re: Replacing characters in filenames
- Subject: Re: Replacing characters in filenames
- From: Guy Algot <email@hidden>
- Date: Tue, 16 Jan 2001 14:00:46 -0700
On 1/16/01 1:11 PM, Peter Huxmann sent:
>
Here's what I've got:
>
>
on open (TestFile)
>
set fileName to every character of (name of (info for alias (TestFile as
>
string)))
>
if fileName contains " " then
>
beep
>
display dialog "Yup, it's got a space, now what?" giving up after 3
>
end if
>
end open
>
>
>
Any suggestions?
Replace your if statement with;
repeat with x from 1 to number of items of fileName
if item x of fileName is " " then
set item x of fileName to "_"
end if
end repeat
fileName as string
Later,
Guy
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Guy Algot, Graphic Dimensions Consulting (403) 861-9882
email@hidden Calgary, Alberta
"The higher, the fewer!" Mac consulting/4D development
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
'Remember that as a teenager you are in the last stage of your
life when you will be happy to hear that the phone is for you'
-- Fran Lebowitz