Re: change case script
Re: change case script
- Subject: Re: change case script
- From: Michelle Steiner <email@hidden>
- Date: Fri, 2 Nov 2001 06:23:19 -0700
On 11/2/01 5:47 AM, jake williamson 28 <email@hidden>
wrote:
>
is it possible to compile a script that takes all the file names in a folder
>
and coverts them to lower case and replaces a space with an underscore??
Here is a brute force method.
--Michelle
tell application "Finder"
set the teststring to the name of file 1 of folder "dora:foo:"
end tell
set the testlist to the text items of the teststring
repeat with letter in testlist
set asc to the ASCII number of the letter
if (asc is greater than 64) and (asc is less than 91) then
set the contents of the letter to ASCII character (asc + 32)
else if asc is 32 then
set the contents of the letter to "_"
end if
end repeat
set the teststring to the testlist as text
tell application "Finder"
set the name of file 1 of folder "dora:foo" to the teststring
end tell
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------