AppleScript to spit out Incremented Number with Leading Zeros
Add a .txt extension to the file you're saving to. If counter is the folder, do this:

set theFile to "z:Users:zachphillips:Dev:AppleScripts:counter:save.txt"


Assuming that you have a valid path, this should fix the problem. Otherwise, you're trying to save to a folder.