title: Automator: Choose from list and getting the corresponding variable value
body: <p>I'm new to AppleScript but I do have some basic knowledge of Automator. Here is what I want to achieve: </p>
  
  <ol>
  <li>There is a simple list of URLs that I often use throughout my work. Like this: </li>
  </ol>
  
  <blockquote>
    <p>Product datasheet: URL1</p>
    
    <p>Licensing: URL2</p>
    
    <p>Price list: URL3</p>
    
    <p>... </p>
    
    <p>etc.</p>
  </blockquote>
  
  <p>In most cases I use these URLs when sending a mail message to a customer, but sometimes I also use them in other applications, like Safari. So the service should be global. </p>
  
  <ol start="2">
  <li><p>I need the service to prompt me with a list of items where each item is the name of a link (like {"Datasheet", "Price list", "Licensing", etc} ). </p></li>
  <li><p>When I select an item and click OK, the service must fetch the URL that corresponds to that link name and then put it in the clipboard, so that I can paste it whenever I need to use it. </p></li>
  </ol>
  
  <p>I followed recommendations in this q&amp;a <a href="https://stackoverflow.com/questions/11440062/automator-how-do-i-use-the-choose-from-list-action">Automator: How do I use the Choose from List action?</a> and created the first action (Run AppleScript). Also, i created a number of variables and specified names and URLs. I.e. I'm going to store the actual list ("database") in the service. There are somewhere between 30 and 50 links/records in total so I don't probably need an external Excel file or something. </p>
  
  <p>What I can't figure out is how to get/fetch the URL from the variable. The Get Value of Variable doesn't work for me because it requires a constant variable name as input. However, I need an action to receive input from the Run AppleScript action, lookup the variables list and fetch the URL and then pass the resulting URL onto the Clipboard action. </p>
  
  <p>Thank you for your help. </p>