But if I remove that, the variable changes aren't saved. What am I doing wrong
The delete does this
Show VIEWERCMD=delete
@evalalways:= InStr(source, "D:\Home\Pictures") >= 0 ? ($glob:img_deleted+=1 ; $glob:imgs-=1) : ""
PersistVariables
And PersistVariables is as below
function OnClick(clickData)
{
DOpus.vars("img_deleted").persist = true;
DOpus.vars("imgs").persist = true;
}