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

joennie

macrumors newbie
Original poster
Jul 29, 2013
2
0
I have a folder with x ammount of subfolders which all contain images.

I need to create the same folder structure but within each folder I need to create a 2 folders, thumbnails and fullsize images and then process each original folder and insert the images into the correct folders

Current format

main folder > imagefolderone > img1
img2
img3

imagefolderone > img1
img2
img3

Required format

main folder > imagefolderone > thumbnail_folder >
thumbnail image1
thumbnail image2
thumbnail image3
main_folder >
main image1
main image2
main image3

> imagefoldertwo > thumbnail_folder >
thumbnail image1
thumbnail image2
thumbnail image3
main_folder >
main image1
main image2
main image3
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
There are several different ways to create folder structures, but sometimes it is easier to create the desired structure using the normal Finder commands, and then copy the template as needed.

Code:
on run -- example
	copyFolderStructure from (choose folder with prompt "choose source folder") to (choose folder with prompt "choose destination folder")
end run

to copyFolderStructure from sourceFolder to destinationFolder
	tell application "Finder"
		repeat with someFolder in (get folders of sourceFolder)
			get name of someFolder
			try
				make new folder at destinationFolder with properties {name:result}
			on error number -48 -- ignore duplicate file name, but continue traversing the structure
				get ((destinationFolder as text) & result) as alias
			end try
			my (copyFolderStructure from someFolder to result)
		end repeat
	end tell
	return
end copyFolderStructure
 

joennie

macrumors newbie
Original poster
Jul 29, 2013
2
0
Thanks so much...if I want to add a generic thumbnail folder, would that be done in the same code, or would I run a separate applescript
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.