Script to sanitise file names

if things were straightforward it would be criss's sanitizeText(theFilename, theDelimiter)

Criss, does local in the sanitizeText handler mean that the variables are only available within the handler and not to other sections of the script? Is there any advantage to doing that in this specific case? Or is it just a good habit…?

It’s just a good habit inside generic functions to avoid that the variables used inside the function might change the variables having the same name outside of the function.

4 Likes

And again I learned something. Didn’t know that Applescript can provide for different scopes. Thanks.

1 Like