Created
September 21, 2015 08:59
-
-
Save koenbok/0bdc3c478131e06d7bdf to your computer and use it in GitHub Desktop.
Get Available Editors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (NSArray *)availableEditors | |
| { | |
| NSArray *appNames = @[@"Sublime Text", @"Sublime Text 2", @"Espresso", @"Textmate", @"Coda", @"Chocolat"]; | |
| NSMutableArray *result = [[NSMutableArray alloc] init]; | |
| for (NSString *appName in appNames) { | |
| NSString *appPath = [[NSWorkspace sharedWorkspace] fullPathForApplication:appName]; | |
| if (appPath) | |
| [result addObject:@{@"name":appName, @"path":appPath}]; | |
| } | |
| return [result copy]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment