Rename folders with incrementing numbers

Hi everyone,

I’m all new to Applescript, so please have mercy! I have gotten quite far by myself but there is only one thing preventing me from finishing my first functional script.

I would like to create new folders that won’t be named “untitled folder”, “untitled folder 1” etc. but rather 1, 2, 3 etc.

Here’s the part of my script it needs to fit in:

count folders of entire contents of fichierrushes
	if the result = 0 then
		set NbrFichiers to count of every item of entire contents of fichiersource
		repeat with i from 1 to NbrFichiers
			make new folder at fichierrushes
		end repeat
	end if

It seems pretty silly and yet I am not managing to find my way out of this one.


repeat with i from 1 to 10
make folder at thePath with properties {name:i}

Thanks a bunch, all working!

I need to get more into repeat loops and the use of “i” :slight_smile: