Re: Rename files excluding xml extension in a folder
Re: Rename files excluding xml extension in a folder
- Subject: Re: Rename files excluding xml extension in a folder
- From: Philip Aker <email@hidden>
- Date: Thu, 17 May 2007 04:08:48 -0700
On 2007-05-16, at 12:03:30, Peter Pq wrote:
I wish to be able to rename all files in a folder chosen by the user but not allow the extensions to be changed.
The folder will contain files comprised of two different extensions.
However, I wish to exclude the script from renaming files with the .xml extension.
Is it possible to rename all files in a chosen folder except those with the xml extension?
Yes. Here is how you can grab only files with the desired extension:
on GetFilesWithExtension(theFolder, theExtension) tell application "System Events" name of every file of theFolder whose name extension is theExtension end tell end GetFilesWithExtension
set fold to (choose folder) set flist to GetFilesWithExtension(fold, "txt")
Philip Aker
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden