So I was making this program that would write every number between 0 and 9999, but I need it to be 4 characters long no matter what the digit count is - the only way to do that, I think, is to have the program count the digits and then put it into a variable, subtracting that variable from 4 and adding that number of zeros before the number itself.
How can AppleScript count the digits? Is there even a way to do it at all?