title: Error message on Applescript duplicate and rename
body: <p>I use this applescript to Archive episodes to a new location using a smal reference-file "Archived.m4v" which is then renamed to the episodes name.
  I keep getting an error message in OSX Yosemite, while under OSX Mavericks it worked perfectly. </p>
  
  <p>error <code>"The variable NewFile is not defined." number -2753 from "NewFile"</code></p>
  
  <p>All questions related to a script like this have the same code, so I'm going nuts here...</p>
  
  <pre><code>set TheFile to alias "Video:Tools:Archived.m4v"
  set Destination to alias "Video:Archives:WIP - TV Shows:"}
  set Source to (choose folder with prompt "Pick the folder with the tv episodes...")
  
  tell application "Finder"
      set theList to every file of entire contents of Source
      repeat with thisFile in theList
          set {tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "."}
          set FileName to (text items 1 thru -2 of (get name of thisFile)) as text
          set NewFile to duplicate TheFile to folder Destination with replacing
          set NewFile's name to (FileName &amp; ".m4v")
      end repeat
  end tell
  </code></pre>