Change whitespace to underscore in AppleScript

Posted in AppleScript on December 13, 2016 · 1 min read
At times I am delivered files with whitespace and while this may not be an issue for some I find trying to script through files the whitespace can be a daunting issue.

To resolve this issue I wrote a simple script that can be saved anywhere, but I would suggest storing the file so it can be executed with the AppleScript icon in the Menu Bar. There is a quicker alternative if you highlight the files with shift click, control plus right click and select Rename x items...  Entering a space in Find and an underscore in Replace. However, text item delimiters are my kryptonite to AppleScripting so here is the script:

Help the site go ad free:
Storm Trooper