Question
I use Stattoo a lot, but almost never use the preferences, so I set out to rid it from my Dock while keeping the functionality. I read online that adding a NSUIElement or LSUIElement sibling with a string of 1 would allow me to do so, but neither work. I even went as far as downloading and installing the developer tools to get the Property List Editor to try out, but that didn’t work either. I’ve tried logging out and restarting afterwards, but to no avail. Any help on my quest to rid the Stattoo icon from my Dock and Force Quit window would be appreciated.
Thanks,
moksha
Answer
The problem is that the Launch Services cache has cached the last Info.plist and is using that instead of the new one because there’s been no change to the application itself. There are two forms of resolution to this problem:
- Change the modification date of the application’s package with
touch before opening it.
- Force the database to update for that item only.
It’s Mac Geekery, so you know where I’m going with this.
The tools for the Launch Services database are a little bit hidden. When I say a little bit, I mean they’re in /System/Library/Frameworks/ApplicationServices.framework/Versions/ A/Frameworks/LaunchServices.framework/Versions/A/Support. That being true, I’m not entirely unsurprised that most people don’t know about lsregister, which is a shame because it fixes things like this real quick.
I’ve symlinked the lsregister program to a place in ~/bin/, which I’ve included in my PATH, so I don’t need to type that full path up there or be in the same directory, even. If you choose the same route, be sure to use the full pathname rather than going into the directory and just doing ln -s lsregister ~/bin/ because that command will make a link to the relative path and it will fail.
lsregister -f MyGreatApp.ap
Now reopen the program and the change should take effect.
For some reason, entering the command you gave me tells me that lsregister isn’t found, even though I navigated to the folder you said and it was there.
Drag the app to the desktop then drag the app back.
Well, yes, but that teaches one nothing about Launch Services.
In the end, I realized that touching a file, which people kept throwing at me as a solution, constituted of nothing more than $ touch /Applications/Stattoo. So, I basically didn’t learn anything about launch services, but I did manage to get Stattoo out of my Dock. Thanks for the help!