remove() Delete() DeleteFile() Issues

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

I'm trying to delete a .txt file from a folder within the ScriptUI Panels folder and it just isn't working for me. I can verify the path correctly and I can read, write and delete content within the file, but I cannot remove the file from the computer at all. I've tried...

My path is "/Applications/Adobe After Effects CS4/Scripts/ScriptUI Panels/myFolder/myfile.txt"

Code: Select all

var fso = new ActiveXObject("Scripting.FileSystemObject");
	goneFile = fso.GetFile(fullPath);
	goneFile.Delete();

Code: Select all

File.remove(fullPath);

Code: Select all

File.DeleteFile(fullPath);

Code: Select all

File.DeleteFile(fullPath.toString());

Code: Select all

fullPath.DeleteFile();

Code: Select all

fullPath.remove();
but I can't get it to delete. Any thoughts?
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

This should work:

var myPath = "/Applications/Adobe After Effects CS4/Scripts/ScriptUI Panels/myFolder/myfile.txt";
var myFile = File(myPath);
myFile.remove();


Dan
User avatar
vfxman
Posts: 49
Joined: February 23rd, 2007, 7:00 pm
Location: California
Contact:

:mrgreen: Works like a charm, you've made me a happy man Dan. Thanks. I knew it was gonna be something that was simple that I was just missing.
Post Reply