02-28-2026, 01:24 AM
Nope, Steve, same deal.
|
Recycle File
|
|
02-28-2026, 01:24 AM
Nope, Steve, same deal.
Code: (Select All)
One last test. This is after pestering AI to sort out the formatting issue. It claims this will work. LOL Tony suggests changing that delete to move and giving it a test if this doesn't work. @NakedApe mind giving both variations a try and see what we break?
02-28-2026, 01:33 AM
And for a file on the desktop to be trashed - on my system:
SHELL "trash /users/me/desktop/myfile.txt"
02-28-2026, 01:34 AM
(02-28-2026, 01:16 AM)NakedApe Wrote: Sorry, ahenry that didn't do it either. 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 !)
02-28-2026, 01:39 AM
Yep, it's just this.
Code: (Select All)
02-28-2026, 01:42 AM
(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. 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 !
02-28-2026, 01:43 AM
@SMcNeill No, no and... no. But points for persistence!
02-28-2026, 01:43 AM
I was hoping to not use trash as this is what I get when searching it on the web:
Quote:Compatibility Across Versions I was looking for something which would be more universal and thought the osascript would do the job, but apparently it's not being good and playing nice like it should. I guess trash it is, and folks may have to tweak as necessary for their own OS version if it's a slightly different syntax as warned about above.
02-28-2026, 01:45 AM
Dunno, ahenry, the code I updated above works like a charm on a modern Mac.
02-28-2026, 01:50 AM
Updated the code to make use of the trash command, but I did put the filename in quotes.
I imagine as it is, it may have issues with something like My File.txt, where there's a space in there. Most command line parsers tend to get blown up unless you keep things together inside quotes like that. |
|
« Next Oldest | Next Newest »
|