/* Full Dopus Delete command with Trashcan feature */
/* By Nils-Erik Reklev Skilnand*/
parse arg portname handle
if portname='' then portname='DOPUS.1'
address value portname
options results
if handle="" then do
lister query source
handle=result
if rc~=0 then exit
end
lf='0a'x
if (show('p','ArcDir'space(handle,0))) then do
lister request handle '"Warning:"'lf'"DelTrash does not work with ArcDir"'lf'"Please configure the Delete button with the normal"'lf'" Delete command for another mouse button"'lf'"Example: Left mouse button DelTrash"'lf'"Right mouse button Delete (dopus command Delete)" Ok'
lister set handle newprogress title "Removing Files ..."
lister set handle newprogress info "Number of files: "entries
lister request handle '"Warning: You cannot get back"'lf'"What you delete! OK to delete"'lf'""'lf'"'files.count' file(s) and"'lf'"'dirs.count' drawer(s)(and their contents)?" Proceed|DeleteAll|Trash All|Cancel'
if rc=1 then do
call subdel
end
if rc=2 then do
do i=i to entries
if (lastpos('d',prot.i)=0&argm~='force'&fuckthem=0) then call pro
if lastpos('d',prot.i)=0 then do
select
when (ch=1|ch=2) then call del
when ch=3 then call pro
when ch=4 then nop
otherwise nop
end
end
else call del
end
end
if rc=3 then do
do i=i to entries
if (lastpos('d',prot.i)=0&argm~='force'&fuckthem=0) then call pro