02-28-2026, 01:53 AM
(02-28-2026, 01:42 AM)ahenry3068 Wrote:(02-28-2026, 01:34 AM)ahenry3068 Wrote:after the if FileExists I would add(02-28-2026, 01:16 AM)NakedApe Wrote: Sorry, ahenry that didn't do it either.
SHELL "trash myfile.txt" works for me when the file is in the current working directory - QB folder here.
Well hell. Then do that ! It's certainly a lot simpler than Applescript.
I would guess it should work with a full pathname too. (adding Quotes around it if it has spaces in it !)
if Instr(File$, chr$(32)) > 0 then File$ = chr$(34) + File$ + Chr$(34)
Space's in file names need to be quoted on the command line !
This would break Windows as we single quote the file names and use double quotes for the entire powershell command.
think of it as powershell -command "RENAME 'whatever.txt' AS 'whatnever.txt' "
The version I updated put those quotes in the mac shell statement, and not where you suggest.
SHELL "trash " + CHR$(34) + file$ + CHR$(34)

