create a custom node token I want to create a new token form the selected item in the list box of currently submited node and set it as url alias of the node.

unfortunately, I need keys of select box as token but default tokens do not have this item(it just has labels of listboxes). so I decided to create it's token programmatically. 

this is the code but I do not know how to set selected item of list box in $value 

function cool_token_token_info() {

  $info['tokens']['node']['key1'] = array(
    'name' =&gt; t('My cool token'),
    'description' =&gt; t('A token I use to show that I am cool.'),
  );
  return $info;
}



function cool_token_tokens($type, $tokens, array $data = array(), array $options = array(),$node=array()) {
  $replacements = array();
  $sanitize = !empty($options['sanitize']);
  if ($type == 'node') {
    // Loop through the available tokens.
    foreach ($tokens as $name =&gt; $original) {
      // Find our custom tokens by name.
      switch ($name) {
        case 'key1':
          // Work out the value of our token.
          if (isset($node)){
                $value= "here I want to have key of the selected item in the listbox of current node";
          }else{
              $value="not working";
          }
          // Give our token it's value!
          $replacements[$original] = $value;
          break;
      }
    }
  }

  return $replacements;
}


I tried 

field_get_items('node', $node, 'field_parent')


and many many other ways but it does not print anything
Check this example code:

/**
* Implements hook_token_info().
*/
function yourmodulename_token_info() {  
  $info['tokens']['node']['city'] = array(
    'name' =&gt; t('Venue City'),
    'description' =&gt; t('Returns the Venue city (Location)'),
  );
  return

$info;
} 


/**
* Implements hook_tokens().
*/
function yourmodulename_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $replacements = array();

  if ($type == 'node' &amp;&amp; !empty($data['node'])) {
    $node = $data['node'];
    if (isset(

$tokens['city'])) {
      $replacements[$tokens['city']] = pathauto_cleanstring($node-&gt;field_location['und'][0]['city']);//here I retrieve the value of the city in the location field.
    }
  }

  return $replacements;
}