I have a setting for external editor that end-user can change in settings. As I want to make my software smart, I want to set button that starts this external software to disabled state, if software is not valid (maybe TextEdit has been moved to Utilities or somewhere else or something else goes wrong, anything can happen, right?)..
// Default setting: /Applications/TextEdit.app
[[NSWorkspace sharedWorkspace] launchApplication: [[NSUserDefaults standardUserDefaults] stringForKey: @"externalapp"]];
I could just make a simple test that location is valid and exists, but for some reason I decided to go the fancy way and came to think that there should be a test that tests this for a proper application - it doesn't need to test it for TextEdit.app - because the whole idea is that you can use nearly any editor you want-- That's why it is customizable in the first place -- but I just want a simple check that we won't encounter problems that could had been avoided by this test.
And yes, I know I should use TextEdit.app to open a file, but I am not in that phase yet, so there isn't anything produced for opening yet, I'll do that later-- in this phase this is enough to see that the idea works and I can do some testing.. But I am listening if someone wants to share good ideas that I maybe haven't yet thought about with this.