title: Call Javascript function from external file with Applescript
body: <p>Is it possible to call a javascript file function in applescript? I can get it to work when written 100% in the applescript file or I can use "do javascript file some file". Is there a way to mix the two? Something like this:</p>
  
  <pre><code>tell application id "com.adobe.Photoshop"
      tell current document
          do javascript "function(Variable1,Variable1)" in file PathtoJSX
      end tell
  end tell
  </code></pre>
  
  <p>The function is located in the external file but I want to pass it variables from applescript.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I posted it when someone else ask but PathtoJSX is the "Path to Javascript file (.jsx)" so PathtoJSX = file "desktop:yourFile.jsx"</p>