title: Applescript: can't make file "xx" into type <<class fsrf>>
body: <p>I'm trying to get a script working which is able to batch export .mts format video files via quicktime into .mov files in 1080p. The script fails with the following error: "The action “Run AppleScript” encountered an error: “QuickTime Player got an error: Can’t make file (document "00000.MTS") into type «class fsrf».”". I assume this has something to do with using text file paths? Note I'm not experienced with Applescript and would really appreciate any help to get this simple bit of script working. Currently it's in automator as a service:</p>
  
  <pre><code>on run {inputFiles}
  if inputFiles is equal to {} then
      set inputFiles to (choose file with prompt "Select the file(s) to convert:" with multiple selections allowed without invisibles)
  end if
  open inputFiles
  end run
  
  on open droppedItems
  tell application "Finder" to set inputFolder to (container of first item of droppedItems) as Unicode text
  set outputFolder to (choose folder with prompt "Select output folder:" default location (inputFolder as alias)) as Unicode text
  
  set exportPreset to (choose from list {"Movie", "iPhone", "iPod", "480p", "720p", "1080p"} with prompt "Choose QuickTime Export Preset:") as Unicode text
  if exportPreset is equal to "false" then
      return
  end if
  
  repeat with currentItem in droppedItems
      repeat until getProcessPercentCPU("CoreMediaAuthoringSessionHelper") is equal to ""
      end repeat
  
      tell application "Finder" to set fileName to name of currentItem as Unicode text
      set fileName to text 1 thru ((fileName's length) - (offset of "." in ¬
          (the reverse of every character of fileName) as text)) of fileName
      convertFile(currentItem, outputFolder &amp; fileName &amp; ".mov", exportPreset)
  end repeat
  end open
  
  on convertFile(inputFile, outputFile, exportPreset)
  
  tell application "QuickTime Player"
      set thisMovie to open inputFile
      open for access file thisMovie
      close access file thisMovie
      export thisMovie in (outputFile) using settings preset exportPreset
      close thisMovie
  end tell
  end convertFile
  
  on getProcessPercentCPU(processName)
  do shell script "/bin/ps -xco %cpu,command | /usr/bin/awk '/" &amp; processName &amp; "$/ {print $1}'"
  end getProcessPercentCPU
  </code></pre>