r := OpenResFileX(HOME & "Icon"); DefConst('kDollar, GetPictAsBits("dollar", nil)); CloseResFileX(r); InstallScript := func (partFrame) begin call kRegNamesRouteScriptFunc with (kAppSymbol, { GetTitle: func(target) begin if GetTargetCursor(target, nil):entry() then "Card Totals"; else nil; // no selections, so don't show in list end, icon: kdollar, RouteScript: func(target, targetView) begin local curs:=GetTargetCursor(target, nil); local e := curs:Entry(); local current_total:=0; local current_count:=0; local purchase_total:=0; local purchase_count:=0; local release_total:=0; local release_count:=0; while e do begin if isnumber(e.current_value) then begin current_count:=current_count+1; current_total:=current_total+e.current_value; end; if isnumber(e.purchase_price) then begin purchase_count:=purchase_count+1; purchase_total:=purchase_total+e.purchase_price; end; if isnumber(e.release_price) then begin release_count:=release_count+1; release_total:=release_total+e.release_price; end; e:=curs:Next(); end; r:=clone(getroot().(kappSymbol).dataframe); r.current_total:=current_total; r.current_count:=current_count; r.purchase_total:=purchase_total; r.purchase_count:=purchase_count; r.release_total:=release_total; r.release_count:=release_count; getroot().(kappSymbol).dataframe:=clone(r); getroot().(kappSymbol):open(); end }); end; RemoveScript:=func(partframe) begin call kUnRegNamesRouteScriptFunc with (kAppSymbol); end;