It looks messy but I got this to work.
It basically opens up the settings document if they exist otherwise displays a javascript alert.
r:=@DbColumn(""""Settings"4);
thisdb:=@ReplaceSubstring(@ReplaceSubstring(@Subset(@DbName; -1);" ""+");"\\""/");
@If(@IsError(r);
@Do(
@SetTargetFrame("_self");@URLOpen("javascript:alert( 'NoSettings created.');history.back(-1);")
);
@URLOpen("/" + thisdb + "/Settings/"+@Subset(r;1)+"?editdocument&login")
)
I suspect a better way would be to call a JS function.
Put this in Action Hotspot instead of similar @SetTarget...:
@SetTargetFrame("_self");@URLOpen("javascript:ShowAlert( 'No Settings created.');")
Put this in JSHeader (Web):
function ShowAlert(sMessage) {
alert(sMessage)
}