02-28-2026, 05:22 PM
@SMcNeill
I tested this variation on my old Mac and it appears to work. The other version deleted the file permanently after fixing it with the slash quotes.
Thank you Steve for the program.
I tested this variation on my old Mac and it appears to work. The other version deleted the file permanently after fixing it with the slash quotes.
Thank you Steve for the program.
Code: (Select All)
OPEN "MyFile.txt" FOR OUTPUT AS #1
PRINT #1, "Test:" + DATE$ + " " + TIME$
CLOSE
PRINT "File created called MyFile.txt"
Recycle "MyFile.txt"
PRINT "MyFile.txt should now be recycled and in the Recycle Bin, instead of just erased permanently."
PRINT "Check your recycle bin to see if it exists there and contains a simple message of 'Test'."
END
SUB Recycle (file$)
IF _FILEEXISTS(file$) THEN
$IF WIN THEN
ps$ = "powershell -NoLogo -NoProfile -Command "
ps$ = ps$ + Chr$(34) + "Add-Type -AssemblyName Microsoft.VisualBasic; "
ps$ = ps$ + "[Microsoft.VisualBasic.FileIO.FileSystem]:eleteFile('"
ps$ = ps$ + file$
ps$ = ps$ + "','OnlyErrorDialogs','SendToRecycleBin')" + Chr$(34)
Shell _Hide ps$
$ELSEIF MAC THEN
cmd$ = "mv " + Chr$(34) + file$ + Chr$(34) + " ~/.Trash/"
Shell cmd$
$ELSE
'Assume Linux-like environment with gio available
SHELL _HIDE "gio trash " + CHR$(34) + file$ + CHR$(34)
$END IF
END IF
END SUB
2D physics engine https://github.com/mechatronic3000/fzxNGN
QB Pool https://github.com/mechatronic3000/QBPool
QB Pool https://github.com/mechatronic3000/QBPool

