Sunday, 20 April 2014

automator help with creating new folders, or maybe a script?


i have folder structure follows items>item name>item colour>files.

in item colour folder 2 files, large sized image , thumbnail version of image. need create folder in here called thumbnail , move thumbnail image it. can automator?

have maybe 30 item name folders various amounts of folders within each of those.

if in code terms it'd every folder in items,open folder go in every folder in here , create directory called thumbnail , move file named closeuptn.jpg here.

i've attached folder structure. starts contents of 'all items' in above description.
 

attached files:

try little script

assume items folder? choose toplevel folder in choose folder dialog when run script.

code:
set the_folder (choose folder prompt "choose “all items“ folder")  set filenameslist paragraphs of (do shell script "find " & quoted form of posix path of the_folder & " -type f -name *tn.jpg")  repeat 1 count of filenameslist  	set thisfileobject (posix file (item of filenameslist) alias)  	-- file object "thisfileobject"  	tell application "finder"  		try  			set tumbnailfolder make new folder in container of thisfileobject properties {name:"thumbnail"}  			move thisfileobject tumbnailfolder  		on error errmsg number errnumber  			display alert errmsg message errnumber  		end try  	end tell  end repeat
 

attached files:



Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment