try
{
var
obj= app.activeDocument.dataSets.getByName(
"データセット 1"
);
}
catch
(e){
obj =
"そのような名前のデータセットはありません"
;
alert(str);