title: Automator variable base on file name (Applescript?)
body: <p>I am trying to use <em>automator</em> to rename files based on the folder I select as the input. I want to take the folder name and if 1 of 4 phrases are found in the folder name, 1 of 4 variables would be used. I don't know <strong>applescript</strong> but I feel this is the way to go base on other languages I know.</p>
  
  <p>Can anyone convert the following concept?</p>
  
  <blockquote>
    <p>if file name contains "USA" then </p>
    
    <p>var = "US"</p>
    
    <p>elseif file name contains "CAN_FR" then </p>
    
    <p>var = "CAFR"</p>
    
    <p>elseif file name contains "CAN_EN" then </p>
    
    <p>var = "CAEN"</p>
    
    <p>end</p>
  </blockquote>
  
  <p>Much appreciation to anyone that can help.</p>