title: Photoshop 8800 Error only after python creates the file
body: <p>I have a bit of a weird situation that I will try to explain the best I can. </p>
  
  <p>I am using Python to launch photoshop and run a javascript file. But my goal is for python to generate the javascript first, then run it in photoshop. 
  In order to do that I have python copying the javascript file, then replacing a single line of code and running this new copy.</p>
  
  <p>When I run the original javascript file it works as intended with no problems. </p>
  
  <p>When I run the copied javascript file it works as intended with no problems.</p>
  
  <p>When I run the copied javascript file that has the line replaced, it gives me an 8800 error.</p>
  
  <p>At this point, even if I manually type the replaced line to match the original javascript file. I will still get an 8800 error. </p>
  
  <p>Does python somehow write files differently? </p>
  
  <p>Here is the code I am using to replace the copy and replace the javascript contents:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>from shutil import copyfile
  
  
  jsx_file = r'E:\PS\_javascript_constructor_template.jsx'
  jsx_file_new = r'E:\PS\_javascript_constructor_template_new.jsx'
  copyfile(jsx_file, jsx_file_new)
  
  with open(jsx_file_new, "r") as fin:
      data = fin.read()
      with open(jsx_file_new, "w") as fout:
          fout.write(data.replace("!REPLACEME!",'"E:\PS\MockVar.csv"'))</code></pre>
  </div>
  </div>
  </p>
  
  <p>Any ideas?</p>
  
  <p>SIDE NOTE: I am only doing this because I have no idea how to pass an argument from python into the javascript file I am subprocess calling. </p>
  
  <p>I would much rather send an argument to the javascript file than build new files enitrely.</p>