Onetastic Macro Documentation >
>
>
GetAncestorOfType GetAncestorOfType
Returns true if the given object has an ancestor of given type and stores that ancestor in the ancestor parameter.
Syntax
Bool GetAncestorOfType(
Object object,
ObjectType type,
out Object ancestor)
Parameters
- Object object
- Object to look for an ancestor of.
- ObjectType type
- Type of the ancestor to look for.
- out Object ancestor
- If an ancestor is found, it is stored in this parameter. Check the return value of the function to know whether an ancestor was found or not.
Examples
$image = QueryObjects("Image", GetCurrentPage())
if (GetAncestorOfType($image, "Table", $tableAncestor))
else
|