title: How to log objects to a console with AppleScript
body: <p>I am just trying to log the state of objects throughout the life of my applescript.  In other languages, object's toString() methods will render the text equivalent and I can use those.  In AppleScript, this does not seem to be the case.</p>
  
  <pre><code>convert applescript object to string (similar to toString)
  </code></pre>
  
  <p>Will output the finder object (and its properties) to the "Results" window of AppleScript Editor, but only if it is the last statement which gets executed.</p>
  
  <p>If I have a trace() statement (which takes a message for logging purposes):</p>
  
  <pre><code>on trace(message)
  do shell script "cat &gt;&gt;~/log/applescript.txt &lt;&lt;END_OF_THE_LOG
  " &amp; (message as text) &amp; "
  END_OF_THE_LOG"
  end trace
  </code></pre>
  
  <p>and try to log the same object, I get</p>
  
  <pre><code>Can’t make properties of application "Finder" into type text.
  </code></pre>
  
  <p>I'm open to better ways of logging to a console, but would like to find out how to write an object's properties (like AppleScript Editor does) in the middle of a script for testing either way.</p>