What’s the use case??
We are deploying multiple sites and generating resources programmatically, so we can’t rely on a resource ID as the parent in a getResources call, however, we do have control over the alias. We can’t always use [[UltimateParent]] so...
I made a tiny snippet called [[GetIDByAlias]]:
<?php
$resources = $modx->getObject(modResource, array('alias' => $alias ));
echo $resources->get('id');
?>
Call:
[[GetIDByAlias? &alias=`myAliasName`]]
This just returns the resource id. I used it as such:
[[!getResources? &parents=`[[GetIDByAlias? &alias=`myAliasName`]]`]]
Hopefully this will help someone searching for something similar.