Pathauto alias programmatically?
You have to prepare the string yourself, manually. You can use the pathauto_cleanstring() helper function that will remove all characters you wouldn't want in the URL (e.g. spaces).

Here's an example:

// The function we need is in the pathauto.inc file.
module_load_include('inc', 'pathauto');
$clean_title = pathauto_cleanstring($string_you_want_to_clear);


Hope this is what you were asking about.