Re: Renaming multiple files
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