• 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: Rename files excluding xml extension in a folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
email@hidden


 _______________________________________________
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

References: 
 >Rename files excluding xml extension in a folder (From: "Peter Pq" <email@hidden>)

  • Prev by Date: Re: Filemaker 8.5 stored applescript problem
  • Next by Date: Ways to check divisibility
  • Previous by thread: Rename files excluding xml extension in a folder
  • Next by thread: Ways to check divisibility
  • Index(es):
    • Date
    • Thread