home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-07-08 | 718 b | 22 lines | [TEXT/ToyS] |
- --
- -- Allow the user to select the folder to be processed. Note that the Choose Folder command
- -- is provided by the Script Tools package
- --
- set folderPath to choose folder¬
- with prompt "Select a folder with files to scan:"
-
- set theExpression to compile regular expression "(.*)\\.([chr])$"
- set theFiles to list folder folderPath
- set theNewFiles to {}
-
- --
- -- Look at each file in the folder and do the appropriate substitutions
- --
- repeat with i from 1 to count of theFiles
- set theNewFiles to theNewFiles & (substitute regular expression theExpression ¬
- of (item i of theFiles) ¬
- with "\\1.\\2 - save")
- end repeat
- {original:theFiles, New:theNewFiles}
- -- Check the result window to see the effects of this script
-