Thank you all for your help so far.
The codes are purely to help me search. I thought if I just keep it to 4 digits, capitals and no special characters then it would make it easier on the eye.
I’ve found a slight issue that I forgot to mention before.
So far my folders output is for instance. ORIO01, ORIO02, ORIO03
This works but I want to add the actual company name before it so it would be like
Orion Building Suppliers (ORIO01)
Orion Building Suppliers (ORIO02)
Orion Building Suppliers (ORIO03)
I managed to get this output by using the following code:
repeat 99 times
set NewName to new & (text -2 thru -1 of ("0" & i))
try
alias ((CurrentDir as text) & ClientName & " (" & NewName & ")")
set i to i + 1
on error
tell application "Finder" to make new folder at CurrentDir with properties {name:ClientName & " (" & NewName & ")"}
exit repeat
end try
end repeat
BUT…
If I had another client called ‘Orion Painting Co’ it would also output (ORIO01) so I would have a duplicate of the 4 digit code (ORIO01) like so…
Orion Building Suppliers (ORIO01)
Orion Painting Co (ORIO01)
Where as it needs to be
Orion Building Suppliers (ORIO01)
Orion Painting Co (ORIO02)
Orion Bubble Gums (ORIO03)
Capcom (CAPC01)
Capcone (CAPC02)
etc