title: Add inverted commas as text in AppleScript
body: <p>I'm trying to make an AppleScript where you change your Mac's local hostname. I'm trying to do it through a terminal command, but if the user wants spaces in the hostname, It doesn't work, as for the command with spaces to work, you need inverted commas, and as far as I'm aware of, you can't do add " as text in AppleScript. Here's what i'm trying to do:</p>
  
  <pre><code>set computername to display dialog "Type the desired name" default answer "" with icon note buttons {"Continue"} default button "Continue" as text
  display dialog (text returned of computername) &amp; " is this correct? " &amp; "."
  
  display dialog "If it askes you, please type your password in. (It may ask more than once)"
  
  do shell script "scutil --set LocalHostName " &amp; """ &amp; (text returned of computername) &amp; """
  
  display dialog "Changes will be applied after a restart. Click continue to save changes and restart."
  
  do shell script "shutdown -r now"
  </code></pre>
  
  <p>I need to enter " before the name is entered, as well as after.</p>
  
  <pre><code> do shell script "scutil --set LocalHostName " &amp; """ &amp; (text returned of computername) &amp; """
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/f5xFW.png" rel="nofollow noreferrer">but I just get errors </a></p>
  
  <p>Thanks in advance</p>