Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Marsheezi

macrumors newbie
Original poster
Apr 8, 2005
1
0
okay i've been looking around and i think its possible, but not sure. hopefully somebody can help me out.

let say i have about 5000 files. all with the name scheme:

10482 Something.jpg
49230 Whatever.jpg
12301 Pleasehelpme.jpg

is there a script that can take the numbers that exist in the first part of the filename and remove the remaining characters from the filename?

ex.
10482 Something.jpg ----> 10482.jpg
49230 Whatever.jpg -----> 49230.jpg
12301 Pleasehelpme.jpg ------> 12301.jpg

the numbers aren't sequential so none of the renaming tools i found can help, and the number of characters after the numbers isnt contant so just chopping off several characters before the file extension wont help.

anythoughts???
thanks in advance
 
okay i've been looking around and i think its possible, but not sure. hopefully somebody can help me out.

let say i have about 5000 files. all with the name scheme:

10482 Something.jpg
49230 Whatever.jpg
12301 Pleasehelpme.jpg

is there a script that can take the numbers that exist in the first part of the filename and remove the remaining characters from the filename?

ex.
10482 Something.jpg ----> 10482.jpg
49230 Whatever.jpg -----> 49230.jpg
12301 Pleasehelpme.jpg ------> 12301.jpg

the numbers aren't sequential so none of the renaming tools i found can help, and the number of characters after the numbers isnt contant so just chopping off several characters before the file extension wont help.

anythoughts???
thanks in advance

tell application "Finder"
set aList to every file of folder (choose folder)
repeat with anItem in aList
set aName to name of anItem
set aName to word 1 of aName&".jpg"
set name of anItem to aName
end
end

/money for nuttin'
//Scripts for free
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.