Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > how do i add jpg extension to 100's of files in a folder?

how do i add jpg extension to 100's of files in a folder?
Thread Tools
lopster
Guest
Status:
Reply With Quote
Oct 12, 2000, 05:02 PM
 
Can anyone tell me how i would go about adding .jpg to a ton of files without having to go in and add it to each individual one. I am also trying to avoid doing a batch in photoshop because i don't want to further compress my images. Any help is appreciated.
     
Forum Regular
Join Date: Nov 1999
Status: Offline
Reply With Quote
Oct 12, 2000, 06:29 PM
 
Hehe, I saw this at a MWNY conference, but sadly I forget the specifics. It was almost exactly the same thing that you want to do. If I remember correctly I think they used a program called "graphics converter", they were also changing the creator type, so it may be different for just adding the .jpg at the end.

Sorry if this was of absolutely no help, but I thought mentioning "graphics converter" might be useful...

EDIT:

The first file listed at this Apple webpage might be what you are looking for: http://www.apple.com/applescript/scr...cripts.00.html

[This message has been edited by ussfolsom (edited 10-12-2000).]

[This message has been edited by ussfolsom (edited 10-12-2000).]
     
Mac Elite
Join Date: May 1999
Location: San Jose, CA
Status: Offline
Reply With Quote
Oct 13, 2000, 02:20 PM
 
The followin script will walk through every file in a folder, appending '.jpg' to the file name.
If offers basic error handling against problems such as file name lengths, but could/should probably be enhanced with additional checks.

The 'on run' and 'on open' handlers are there to allow the script to be launched by either running the script (in which case it prompts for the folder to process) or by dropping a folder onto the script icon (in which case it processes that folder). These handlers don't have any significance on the script process itself and all the work is done in the 'ProcessAFolder' handler.

Code:
on ProcessAFolder(aFolder) tell application "Finder" -- get a list of the files in the folder set theFiles to contents of folder aFolder -- loop through each one repeat with aFile in theFiles -- check its file type - only change documents, not folders or aliases if class of aFile is document file then -- 'try' gives basic error handling, e.g. file name length errors try -- rename the file set name of aFile to (((name of aFile) as string) & ".jpg") end try end if end repeat end tell end ProcessAFolder on open of folderList -- Drag and drop handler. Process each folder dropped on the script. repeat with aFolder in folderList ProcessAFolder(contents of aFolder) end repeat end open on run -- Run handler. Prompt the user for a folder to process. set theFolder to choose folder ProcessAFolder(theFolder) end run
Gods don't kill people - people with Gods kill people.
     
lopster
Guest
Status:
Reply With Quote
Oct 16, 2000, 05:03 PM
 
THANKS!!!!! You guys are the best. I am flyin' high now.
     
zekeoid
Guest
Status:
Reply With Quote
Oct 23, 2000, 09:41 PM
 
Debabelizer has a batch utility, and Photoshop can create actions that will repeat at the touch of the button
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:03 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2