delete -rw-r--r-- files?

hello everybody,
I need to know if there’s a way to delete every file in a folder with these permissions -rw-r–r-- via applescript


something like this? it’s a handler and i didn’t test it, so it’s possible that it doesn’t work

on checkAndDelete(thefile)

set myName to do shell script "whoami"

tell application "Finder"
	set theOwner to owner of file thefile
	set OwnerPrivileges to owner privileges of file thefile
	set groupPrivileges to group privileges of file thefile
	set everyonesPrivileges to everyones privileges of file thefile
	set theCheckList to {myName, read write, read only, read only}
	set theList2BeChecked to {theOwner, OwnerPrivileges, groupPrivileges, everyonesPrivileges}
	if theCheckList is equal to theList2BeChecked then
		do shell script "rm -Rf " & quoted form of (POSIX path of (file thefile))
	end if
end tell
end checkAndDelete

Model: iMac G5
AppleScript: 2
Browser: Safari 125.12
Operating System: Mac OS X (10.3.9)

I realize this a site all about AppleScript, but why make the job harder than it needs to be?

do shell script “find /Users//myProject -perm 644 -exec rm -f ‘{}’ ;”

Or, if you don’t want to decend into subdirectories and just want files in the top “myProject” directory:

do shell script “find /Users//myProject -perm 644 -maxdepth 1 -exec rm -f ‘{}’ ;”

yes you are right I made things too complicated and this is exactly what I was looking for so thanks you very much!

i got a syntax error at first but it was because I was missing one more "" at the end of the script - everything works GREAT now

thank you again!