• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: change from upper to lower case
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: change from upper to lower case


  • Subject: Re: change from upper to lower case
  • From: Michael Schmidt <email@hidden>
  • Date: Fri, 19 Dec 2003 17:26:10 +0100

Hi,

Does anyone know of a script to change a folder of 400 files from upper case to lower case, for example

H001H44 to h001h44
C251C56 to c251c56

etc., etc.,


Hi!
First shot, works with 7-bit-ASCII-Names:

on run
set lowercaseFolder to (choose folder with prompt "Select the folder to lowercase files")
if lowercaseFolder - "" then
tell application "Finder"
set filesToRename to every file in folder lowercaseFolder
repeat with aFile in filesToRename
set name of aFile to my lowercase(name of aFile)
end repeat
end tell
end if
end run

on lowercase(aText)
set retourStr to ""
repeat with aChar in text items of aText
set thisAsciiNo to ASCII number of aChar
if thisAsciiNo is less than 91 and thisAsciiNo is greater than 64 then
set retourStr to retourStr & (ASCII character (thisAsciiNo + 32))
else
set retourStr to retourStr & aChar
end if
end repeat
return retourStr
end lowercase

Greetings from Hamburg and merry christmas!
Michael Schmidt
_______________________________________________
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.

  • Follow-Ups:
    • Re: change from upper to lower case
      • From: Graff <email@hidden>
References: 
 >change from upper to lower case (From: "Buttery, Ian" <email@hidden>)

  • Prev by Date: Re: change from upper to lower case
  • Next by Date: Free or cheap calendar and clock controls for Studio?
  • Previous by thread: change from upper to lower case
  • Next by thread: Re: change from upper to lower case
  • Index(es):
    • Date
    • Thread