| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
This will swap around the name as you have requested. I'm not sure of how to go about changing under what application the file automatically opens in:
------------
set theFolder to choose folder
set oldDelims to text item delimiters
tell application "Finder"
set theList to every file in theFolder
repeat with currItem in theList
try_______________________________________________
set theName to the name of currItem
set theExtension to ""
try
set AppleScript's text item delimiters to "."
set plainName to text item 1 of theName
set theExtension to text item 2 of theName
end try
if theExtension is "" then
set plainName to theName
end if
set AppleScript's text item delimiters to "_"
set firstElement to text item 1 of plainName
set secondElement to text item 2 of plainName
set nameString to secondElement & "_" & firstElement
if theExtension is not "" then
set nameString to nameString & "." & theExtension
end if
set (name of currItem) to nameString
end try
end repeat
end tell
set text item delimiters to oldDelims
------------
- Ken
On Dec 27, 2003, at 7:32 PM, Rob Lewis wrote:
I have a folder with over 500 files in it. The file names are of the form:
Item_Topic.html
I would like a script to change the files names to:
Topic_Item.html
(just interchange the text on either side of the underscore and before the suffix).
While I'm at it, I'd like to change the "open with" parameter from Internet Explorer to Safari.
| References: | |
| >File name manipulation (From: Rob Lewis <email@hidden>) | |
| >Re: File name manipulation (From: Graff <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.