Code: Select all
specialFolderPath("documents")
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Code: Select all
specialFolderPath("documents")
Code: Select all
on mouseUp
## Save some typing by puttin the path into a variable:
put specialfolderpath("documents") & "/" into tDocFolder
## specialfolderpath() names do not come with a trailing SLASH!
## Get a list of all files in that folder:
put files(tDocFolder) into tFiles
## Exclude all non txt fiels:
filter tFiles with "*.txt"
## Now delete all the files in the list of files:
repeat for each line tFile in tFiles
## Create full path to the files and delete them:
delete file (tDocFolder & tFile)
end repeat
end mouseUp
Respectfully, your good nature as expressed here before suggests to me that you don't actually want to do that. If you were successful you'd eliminate most or all of the user-made content from the machine.liveCode wrote: ↑Wed Apr 20, 2022 4:58 pmHow to delete all text files in the path:Code: Select all
specialFolderPath("documents")