try
{
var
myVar=app.activeDocument.variables.getByName(
"変数1"
);
alert(myVar);
}
catch
(e){
alert(
"そのような名前の変数はありません"