And if what you want is just an indication of whether or not there are captions attached, just change:
if ($cap_result->totalCount){
to:
if (!$cap_result->totalCount){
echo "No caption assets\n";
}
And if what you want is just an indication of whether or not there are captions attached, just change:
if ($cap_result->totalCount){
to:
if (!$cap_result->totalCount){
echo "No caption assets\n";
}