try
{
var
myGrad=app.activeDocument.gradients.getByName(
"ホワイト、ブラック"
);
alert(myGrad);
}
catch
(e){
alert(
"該当する名前のグラデーションはありません。"