NSSavePanel *panel = [NSSavePanel savePanel];
panel.allowedFileTypes = @[ @"enjoyable" ];
NJMapping *mapping = _currentMapping;
- panel.nameFieldStringValue = mapping.name;
+ panel.nameFieldStringValue = [mapping.name stringByFixingPathComponent];
NSWindow *window = NSApplication.sharedApplication.keyWindow;
[panel beginSheetModalForWindow:window
completionHandler:^(NSInteger result) {
[pboard setString:@(rowIndexes.firstIndex).stringValue forType:PB_ROW];
[pboard setPropertyList:@[@"enjoyable"] forType:NSFilesPromisePboardType];
return YES;
+ } else if (rowIndexes.count == 1 && rowIndexes.firstIndex == 0) {
+ [pboard declareTypes:@[NSFilesPromisePboardType] owner:nil];
+ [pboard setPropertyList:@[@"enjoyable"] forType:NSFilesPromisePboardType];
+ return YES;
} else {
return NO;
}