Adding JS to a specific URL
Yes, this is the function you are looking for: 

function mythemename_preprocess_page(&amp;$vars, $hook) {
  if(request_path() == 'your_path') {
    drupal_add_js(path_to_theme().'/js/yourjs.js');
  }

  $vars['scripts'] = drupal_get_js();
}


Request path is an easier way to do this than the &lt; Drupal 6.x method of reading the arg() string (ex. if arg(0) === 'node' &amp;&amp; arg(1) === 'some node id')