title: Setting a label to a file with AppleScript
body: <p>I'm trying to put a colored label on a file with AppleScript using the following code:</p>
  
  <pre><code>set theFile to "HDD:Path:to:the:file.ext"
  
  tell application "Finder"
      set label of file theFile to 3
  end tell
  </code></pre>
  
  <p>but when I run it in a terminal with <code>osascript theScript.scpt</code> I get the following error:</p>
  
  <blockquote>
    <p>theScript.scpt:144:178: execution error: Finder got an error: Can't set label of document file "file.ext" of folder "the
    " of folder "to" of folder "Path" of startup disk to 3. (-10006)</p>
  </blockquote>
  
  <p>Any ideas why I'm having an issue and how can I make it work?</p>