Skip to main content
edited title
Link
Prokop Hanzl
  • 1.2k
  • 3
  • 11
  • 36

Applescript AppleScript - how to count integer length?

Source Link
Prokop Hanzl
  • 1.2k
  • 3
  • 11
  • 36

Applescript - how to count integer length?

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?