I have the following setup:

A grid of 4x4 (16 total) buttons (standard NSButton buttons) in an NSWindow.

The NSWindow will come to the front when I press a hotkey combination (DDHotKey)

Now, what I'd like to do is give my buttons the following functionality:

* When the button is clicked, open a dialog that shows the /Applications/ directory and allow me to select any of the applications listed there.
* When the application is selected store it in a variable (I'm guessing) (or string?) and make it so that when the buttons Key Equivalent is pressed, that application launches

I'm looking around and I'm not exactly sure what to do or really where to begin looking...any clues?

I have this in my appdelegate.m file:

```
- (void)openDoc:(id)sender
{
    int result;
    NSArray *fileTypes = [NSArray arrayWithObject:@"td"];
    NSOpenPanel *oPanel = [NSOpenPanel openPanel];

[oPanel setAllowsMultipleSelection:YES];
result = [oPanel runModalForDirectory:NSHomeDirectory()
                file:nil types:fileTypes];
if (result == NSOKButton) {
    NSArray *filesToOpen = [oPanel filenames];
    int i, count = [filesToOpen count];
    for (i=0; i<count; i++) {
        NSString *aFile = [filesToOpen objectAtIndex:i];
        id currentDoc = [[ToDoDoc alloc] initWithFile:aFile];
    }
}
}

```

How do I link the button to it?