02-28-2026, 01:06 AM
I'm not a MAC guru but I consulted one I know on another board.
Lets try this !
Lets try this !
Code: (Select All)
Screen _NewImage(800, 600, 32)
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
' Build an osascript command that tells Finder to delete the POSIX file (move to Trash)
' Use single quotes around the whole -e argument in the shell, and escape inner double quotes for AppleScript.
cmd$ = "osascript -e 'tell application " + Chr$(34) + "Finder" + Chr$(34)
cmd$ = cmd$ + " to move POSIX file "
cmd$ = cmd$ + Chr$(34) + file$ + Chr$(34) + " to trash'"
Shell _Hide cmd$
$Else
'Assume Linux-like environment with gio available
Shell _Hide "gio trash " + Chr$(34) + file$ + Chr$(34)
$End If
End If
End Sub

