I'm Stumped why won't this code delete this one file?

I’m Stumped why won’t this code delete this one file?




try
	do shell script "/bin/rm /Library/Frameworks/" & "VSearch.framework" with administrator privileges
end try




Thanks Big Jack

as mentioned before, remove the try block to get an error message
as mentioned before twice, please use applescript tags

Your script fails for two reasons :

(1) your framework is a directory so the instruction needs the -d option

(2) the framework directory is not empty so the instruction needs the -R option

do shell script "/bin/rm -dR /Library/Frameworks/" & "VSearch.framework" with administrator privileges

will do the job if the framework is available.

Yvan KOENIG (VALLAURIS, France) vendredi 26 septembre 2014 15:13:57

PS: here we are supposed to use the AppleScript tags which are inserted when we click the button [ AppleScript ] above the row of smileys in the edit area.
You added the entry one but failed to insert its closing counterpart : [slashapplescript]
Of course, in real life, the five letters slash must be replaced by a true slash character.

The option -R will do just fine Yvan (the -R has implicitly the option -d in it, making -d an understatement).

Ok it did work forgot to out my test file there

Thanks, I forgot this behavior.

Yvan KOENIG (VALLAURIS, France) vendredi 26 septembre 2014 18:05:50