title: Applescript: expected expression but found "/"
body: <p>I'm looking for a script that will save the url's of my open tabs in Safari to a text document, so that I can open them later (its 10+ tabs). I found this script online:</p>
  
  <pre><code>[applescript]
  tell application "Safari"
  
  --Variables
  set windowCount to number of windows
  set docText to ""
  
  --Repeat for Every Window
  repeat with x from 1 to windowCount
  set tabcount to number of tabs in window x
  
  --Repeat for Every Tab in Current Window
  repeat with y from 1 to tabcount
  
  --Get Tab Name &amp; URL
  set tabName to name of tab y of window x
  set tabURL to URL of tab y of window x
  
  set docText to docText &amp; "&lt;a href=" &amp; "\"" &amp; tabURL &amp; "\"&gt;" &amp; tabName &amp; "&lt;/a&gt;" &amp; linefeed as string
  end repeat
  
  end repeat
  end tell
  
  --Write Document Text
  tell application "TextEdit"
  activate
  make new document
  set the text of the front document to docText
  end tell
  
  [/applescript]
  </code></pre>
  
  <p>But when I try to run this I get the error </p>
  
  <blockquote>
    <p>Expected expression, but found "/"</p>
  </blockquote>
  
  <p>and it marks the last line, [/applescript] as being wrong. I've searched for the error but can't seem to find it. anyone got an idea?</p>