• 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: Renaming multiple files
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Renaming multiple files


  • Subject: Re: Renaming multiple files
  • From: Philip Aker <email@hidden>
  • Date: Thu, 4 Dec 2008 05:52:00 -0800

On 2008-12-04, at 05:45:24, Miguel Moya wrote:

Many thanks Philip for your prompt reply.
I'll try it and let you know.

I hope your mailer doesn't mess up the text of the script -- it will never work as quoted below!



In the script below change the "*cp -f*" in 'do shell script' to "*mv -f*" once you are sure everything works ok.

set *indir* to (choose folder with prompt "*Choose Input Folder*")
set *outdir* to (choose folder with prompt "*Choose Output Folder*")
set *inpath* to POSIX path of *indir*
set *outpath* to POSIX path of *outdir*
tell application "*System Events*"
set *flist* to name of files of *indir* whose name extension is "*xls*"
end tell
repeat with *i* from *1* to count of *flist*
set *infile* to (*inpath* & item *i* of *flist*)
set *outfile* to (*outpath* & (*i* as text) & "*.xls*")
do shell script "*cp -f *" & quoted form of *infile* & space & quoted form of *outfile*
end repeat


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
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: 
 >Renaming multiple files (From: Miguel Moya <email@hidden>)
 >Re: Renaming multiple files (From: Philip Aker <email@hidden>)
 >Re: Renaming multiple files (From: Miguel Moya <email@hidden>)

  • Prev by Date: Re: Renaming multiple files
  • Next by Date: Applescript that compares two directories.
  • Previous by thread: Re: Renaming multiple files
  • Next by thread: Re: Renaming multiple files
  • Index(es):
    • Date
    • Thread