Hi
I am trying to find a way to rename certain files within a folder, to make room for incoming files. The reason is this:
I have a personal photo website that displays 9 images per gallery, and I intend to have quite a few galleries. The images and their thumbnails are stored inside a folder - 9 of each, so 18 images per gallery. The trouble is, I don’t always create new galleries for new images - I often need to push old images out to allow new images in. As I want to push the oldest images out, I am forced to rename 16 files per gallery everytime I want to add new images!
Here’s how a gallery’s images are named: (the Fgallery are the fullsize images, the gallery ones are thumbnails)
Fgallery1-1.jpg
Fgallery1-2.jpg
Fgallery1-3.jpg
etc etc
Fgallery1-8.jpg
Fgallery1-9.jpg
gallery1-1.jpg
gallery1-2.jpg
gallery1-3.jpg
etc etc
gallery1-8.jpg
gallery1-9.jpg
So if I want to insert 2 new pics, the following files get pushed out:
Fgallery1-8.jpg
Fgallery1-9.jpg
gallery1-8.jpg
gallery1-9.jpg
then I have to rename Fgallery1-1.jpg to Fgallery1-3.jpg, Fgallery1-2.jpg to Fgallery1-4.jpg…, aswell as gallery1-1.jpg to gallery1-3.jpg, gallery1-2.jpg to gallery1-4.jpg…quite laborious as you can see!!! Finally I’m left with 2 free spots in each size (thumb and full) (Fgallery1-1.jpg and Fgallery1-2.jpg, gallery1-1.jpg and gallery1-2.jpg) where I can put two new images.
Isn’t there an easier way to do this? What would be cool is if I was prompted for how many photos I wanted to insert, and then the script pushed this many out and renamed the rest, freeing up x number of spots at the start. The reason I need to add photos at the start of the sequence is it’s these pics that get displayed first in the gallery, so it makes sense to have the newest pics here.
If this can work, how can it also be made to work with other galleries…? Other galleries take this form : Fgallery2-1.jpg and its thumbnail image, gallery2-1.jpg.
Any help would be greatly appreciated!
Thanks,
Matthew
PS - I have searched the forums for similar threads but haven’t turned anything up that helps me.
Model: iMac G5 2Ghz
Browser: Safari 312.6
Operating System: Mac OS X (10.4)