ok solved the above by changing to this
$output['loginRes'] = $modx->runProcessor('security/login', array(
'username' => 'fred', /*$username*/
'password' => 'jhfdsksdj' /*$password *//
), array (
'processors_path' => '/home/handswor/public_html/core/model/modx/processors'
));
problem is now that $output[’loginRes’] is set to null no matter if the user exists or not so there is no way to determine if the login was successful.
I should say that I am running this in an external file not a snippet but have this
require_once '/home/handswor/public_html/config.core.php';
require_once MODX_CORE_PATH . 'config/' . MODX_CONFIG_KEY . '.inc.php';
require_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->initialize('Development');
at the top of the file.