Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bobbydd21

macrumors regular
Original poster
Nov 26, 2012
233
25
Hey guys! So I saved an application I made in automator to my desktop. Went to delete it today and it won't delete. I've tried everything. In fact, it won't even move off my desktop. I drag it to the trash, it asked me for my password, makes the trash noise, but stays on the desktop. Same thing happens when I try to move it. I hear the drop noise but it is still on my desktop.

If I show package contents the only folder inside is an empty folder called contents, which cannot be deleted no matter what I do. I have tried every terminal command (unlocking, rm, etc.), disabled system integrity, tried several third party apps, and repaired permission.

Please help!
 

Attachments

  • Screen Shot 2018-02-27 at 10.24.01 PM.png
    Screen Shot 2018-02-27 at 10.24.01 PM.png
    236.7 KB · Views: 545
  • Screen Shot 2018-02-27 at 10.23.55 PM.png
    Screen Shot 2018-02-27 at 10.23.55 PM.png
    234.1 KB · Views: 261
Last edited:
Hey guys! So I saved an application I made in automator to my desktop. Went to delete it today and it won't delete. I've tried everything. In fact, it won't even move off my desktop. I drag it to the trash, it asked me for my password, makes the trash noise, but stays on the desktop. Same thing happens when I try to move it. I hear the drop noise but it is still on my desktop.

If I show package contents the only folder inside is an empty folder called contents, which cannot be deleted no matter what I do. I have tried every terminal command (unlocking, rm, etc.), disabled system integrity, tried several third party apps, and repaired permission.

Please help!

Two possibilities are that either it fails to delete, or that it does get deleted but that Automator (or something) immediately re-creates it.

What happens if you use "rm" in the terminal - do you get an error message or does the rm command complete without error? If you do get an error message you may want to try "ls -lO filename" (or "ls -lOR") to see if the permissions/ownership is wrong and/or it has immutable flags.

If the "rm" succeeds but the action comes back, then presumably Automator is re-creating it.

You might also try quitting Automator while you delete the action, and/or "find ~ -name \*actionname\* -print" to see if there are other parts of the action not on your desktop.
 
Maybe check the file modification/creation dates to see if it's being recreated when you delete it.

Assuming you have an admin account, you could try this in Terminal:

sudo rm -f /path/to/your/file

...you'll be prompted for a password to delete.

Give that a go and report back!
 
  • Like
Reactions: DeepIn2U
What happens if you use "rm" in the terminal - do you get an error message or does the rm command complete without error? If you do get an error message you may want to try "ls -lO filename" (or "ls -lOR") to see if the permissions/ownership is wrong and/or it has immutable flags.

sudo rm -f /path/to/your/file

...you'll be prompted for a password to delete.

Give that a go and report back!

"rm -rf" returns the following error:
rm: /Users/bobbydolan/Desktop/Untitled.app/Contents: Operation not permitted

"ls -lO" returns the following:
MacBook-Pro:Desktop bobbydolan$ ls -lO /Users/bobbydolan/Desktop/Untitled.app

total 0

drwxrwxrwx 2 bobbydolan staff - 64 Feb 27 22:03 Contents



The date of creation doesn't seem to be changing from the original date either :/
 
Mmmmm... okay. That's a bit of a head-scratcher then.

I'm clutching at straws now, but maybe try the obvious stuff e.g. restarting your Mac. Also try renaming the app and/or moving it to another folder and see what happens.
 
Mmmmm... okay. That's a bit of a head-scratcher then.

I'm clutching at straws now, but maybe try the obvious stuff e.g. restarting your Mac. Also try renaming the app and/or moving it to another folder and see what happens.

I know how you feel. I've been trying to figure this out for weeks now. Tried booting into safe mode, disabling system integrity, and even trying to replace it with a backup of the file. NOTHING works haha. It can't be moved or renamed either.
 
Hmmm... Have you checked what the owner and group of the app are?

ls -l /path/to/your/app

It says the owner is "staff":
MacBook-Pro:Desktop bobbydolan$ ls -l /Users/bobbydolan/Desktop/Untitled.app

total 0

drwxrwxrwx 2 bobbydolan staff 64 Feb 27 22:03 Contents

Not sure what that means.
 
While you said the date hasn’t changed, if all of the other solutions aren’t doing the trick, my guess is take a closer look at Automator.
 
It says the owner is "staff":
MacBook-Pro:Desktop bobbydolan$ ls -l /Users/bobbydolan/Desktop/Untitled.app

total 0

drwxrwxrwx 2 bobbydolan staff 64 Feb 27 22:03 Contents

Not sure what that means.

Untitled.app is a directory (as all .app "files" are), so what you're getting is a list of the contents of that directory, which is another directory inside it named "Contents". To see the permissions of Untitled.app itself, add the 'd' switch to ls:

ls -ld /Users/bobbydolan/Desktop/Untitled.app

BTW, your ls above is telling you that "Contents" owner is "bobbydolan" and group is "staff" (both are as expected).

The problem is most likely not permissions, but that the app is still in use somehow, i.e., some file(s) in that .app directory are still open. This can be checked with:

lsof | grep Untitled.app

This will list all open files and then filter that, returning only lines containing "Untitled.app" in the path. The first name on each line is the app owning the file, which you may be able to quit to release it.

Don't know what's going on with Automator... I created a simple Untitled.app asking for text input, ran it, and tried deleting it, and it told me the file was open, as it should have, but after quitting that app it deleted fine.

It could be something strange with whatever your Untitled.app is doing. Try creating a brand new app that just does something simple, and test deleting that. If it works, add more until it fails to be deletable.
 
Untitled.app is a directory (as all .app "files" are), so what you're getting is a list of the contents of that directory, which is another directory inside it named "Contents". To see the permissions of Untitled.app itself, add the 'd' switch to ls:

ls -ld /Users/bobbydolan/Desktop/Untitled.app

BTW, your ls above is telling you that "Contents" owner is "bobbydolan" and group is "staff" (both are as expected).

The problem is most likely not permissions, but that the app is still in use somehow, i.e., some file(s) in that .app directory are still open. This can be checked with:

lsof | grep Untitled.app

This will list all open files and then filter that, returning only lines containing "Untitled.app" in the path. The first name on each line is the app owning the file, which you may be able to quit to release it.

Don't know what's going on with Automator... I created a simple Untitled.app asking for text input, ran it, and tried deleting it, and it told me the file was open, as it should have, but after quitting that app it deleted fine.

It could be something strange with whatever your Untitled.app is doing. Try creating a brand new app that just does something simple, and test deleting that. If it works, add more until it fails to be deletable.

Okay I did what you suggested and got the following.

(1)
ls -ld /Users/bobbydolan/Desktop/Untitled.app

drwxrwxrwx@ 3 bobbydolan staff 96 Jan 13 17:51 /Users/bobbydolan/Desktop/Untitled.app

(2) I put in "lsof | grep Untitled.app" and nothing was returned.

I have tried creating a new simple app, running it, and saving it. Everything works fine and I am able to delete the new app off my desktop with no problem.
 

Attachments

  • Screen Shot 2018-02-28 at 4.07.10 PM.png
    Screen Shot 2018-02-28 at 4.07.10 PM.png
    65.4 KB · Views: 189
Looking over earlier posts, I see your "rm" got an "Operation not permitted", not "Permission denied". That points to SIP and the special flags. Try the "ls -lOd" (capital O, not zero) on the file again to see if it has the schg flag set. If so, first try:

cd ~/Desktop
sudo chflags noschg Untitled.app

That security flag will keep it from being deleted, and may only be clearable when booted in single-user mode (though I was able to delete it as root in El Capitan, not single-user).
 
Looking over earlier posts, I see your "rm" got an "Operation not permitted", not "Permission denied". That points to SIP and the special flags. Try the "ls -lOd" (capital O, not zero) on the file again to see if it has the schg flag set. If so, first try:

cd ~/Desktop
sudo chflags noschg Untitled.app

That security flag will keep it from being deleted, and may only be clearable when booted in single-user mode (though I was able to delete it as root in El Capitan, not single-user).

Hmm, interesting point. I got the following:

ls -lOd /Users/bobbydolan/Desktop/Untitled.app

drwxrwxrwx@ 3 bobbydolan staff sappnd 96 Jan 13 17:51 /Users/bobbydolan/Desktop/Untitled.app

Does this mean it has the schg flag set? I typed in the other two lines you mentioned and tried to delete it but still nothing.
 
Ok, so it has the sappnd (system append-only) flag set. Flags, if any, appear between group and date. I don't know why that would be set, but you can try clearing it using chflags (may require single-user mode):

cd ~/Desktop
sudo chflags nosappnd Untitled.app

Macworld has more about these flags.
 
  • Like
Reactions: willmtaylor
Ok, so it has the sappnd (system append-only) flag set. Flags, if any, appear between group and date. I don't know why that would be set, but you can try clearing it using chflags (may require single-user mode):

cd ~/Desktop
sudo chflags nosappnd Untitled.app

Macworld has more about these flags.

YES! It worked! Finally deleted after two weeks haha. Thank you so much! Very strange how it got that flag though.
 
  • Like
Reactions: willmtaylor
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.