I have a property which has an array of files names. Some are system level and some are home level, which mean its under the library folder of my personal directory. The system files delete successfully, however, the home level files do not. I usually access them like this: ~/Library/Application Support/Software
And then I have a loop which picks each file and deletes it with an rm -R shell script command with administrator privileges.
Am I accessing the home directory the wrong way? Should I use the “~” key?
Also, the “Application Support” folder has to be recognized like this in UNIX “Application\ Support/”, but the way I’m setting it as a string in my property, I cannot do that.
do shell script "rm -rf ~/Library/Application\\ Support/A\\ FOLDER/" with administrator privileges
do shell script "rm -rf ~/Library/Application\\ Support/A\\ TEST\\ FOLDER/" with administrator privileges and password
do shell script "rm -rf ~/Library/Application\\ Support/Test\\ File.txt" with administrator privileges and password
do shell script "rm -rf ~/Library/Application\\ Support/Test\\ File\\ 2.txt" with administrator privileges and password
Tom
Browser: Safari 525.18
Operating System: Mac OS X (10.4)
Interesting! Given the purpose and documentation for ‘try’ the strange behavior is that it worked for you tom. Are you sure your first folder/file didn’t exist when you tried it?
James, I tried every combination and it always deletes any file or folder that is in the Application Support folder.
I guess it doesn’t work for you either.
“any file or folder” means, you have always 4 existing files and folders.
create the same 4 files and folders again, then rename in your script ~/Library/Application\ Support/A\ FOLDER/
with ~/Library/Application\ Support/A\ FOLDER_ONE/