title: AppleScript is throwing a stack overflow error on changing file extension
body: <p>Why does this function throw a stack overflow error?</p>
  <pre><code>on convertFileExtenstion(parentFolder, thisFile)
    set filePath to ((parentFolder as text) &amp; thisFile) as alias
    if my fileExists(filePath) is equal to true then
       set name extension of filePath to &quot;txt&quot;
       log filePath
    end if
  
  end convertFileExtenstion
  
  on fileExists(theFile)
    set fileExists to false
    tell application &quot;Finder&quot;
        if exists (file theFile as alias) then
            set fileExists to true
        end if
    end tell
  
    return fileExists
  end fileExists
  </code></pre>
  <p>The file is just on my desktop, I am only trying to change the extension on one file.</p>
  <p>path: <code>Macintosh HD:Users:xxxxxxxxx:Desktop:prebidServerBidders:client.yaml</code></p>
  <p>Edit: It's not just extensions, I can't change the file name either.</p>