Skip to content

Instantly share code, notes, and snippets.

@koenbok
Created September 21, 2015 08:59
Show Gist options
  • Select an option

  • Save koenbok/0bdc3c478131e06d7bdf to your computer and use it in GitHub Desktop.

Select an option

Save koenbok/0bdc3c478131e06d7bdf to your computer and use it in GitHub Desktop.
Get Available Editors
- (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