Re: delete first 3 characters in a file name
Re: delete first 3 characters in a file name
- Subject: Re: delete first 3 characters in a file name
- From: Bill White <email@hidden>
- Date: Thu, 09 Dec 2004 12:32:46 -0500
On 12/9/04 11:40 AM, Jan-Bultereys <email@hidden> wrote:
> select a couple of files in a folder all starting with 001_test, 103_test2,
> 203_test3 for example then rename them to test1, test2, test3.....
You're actually getting rid of *four* characters because the underscore is
in there. If you're selecting the files manually, then simplistically this
will do it:
tell application "Finder"
set theFiles to the selection
repeat with i from 1 to count theFiles
set oldName to name of item i of theFiles
set newName to characters 5 thru -1 of oldName as string
set name of item i of theFiles to newName
end repeat
end tell
There's no error checking here, but it should get you started.
-- Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden