title: AppleScript "if contain"
body: <p>I have a script which look for the name and search for a match with a another variable.</p>
  
  <p>It's working fine however if the variable 1 is "Name Demo" and variable 2 is "Demo Name" then the script don't find a match. </p>
  
  <pre><code>set nameMatchTXT to ""
  if NameOnDevice contains theName then
      set nameMatch to theName &amp; " : Name Match"
  end if
  </code></pre>
  
  <p>Is there anyway to change this to find the match whatever the order ? 
  PS the script is looking for word wild name, and sometime handle dual bit characters which can be a difficulty.</p>