Question: I'm going to elaborate a file containing some text and email addresses in this way:

```
TEXT\n
Cc: mail1,\n
    mail2,\n
    mail3\n
EMPTY LINE\n
TEXT

```

I have to load into a bash variable the Cc list: FOO="mail1, mail2, mail3". How can I do with sed (or other command)?

Answer: 
I don't think mdominick's answer is correct. Since I only wanted to disable the NSTextFields and NSButtons, I came up with this:

```
for (NSView *item in [self.window.contentView subviews])
{
    if ([item isKindOfClass:[NSTextField class]] || [item isKindOfClass:[NSButton class]])
    {
        [(id)item setEnabled:NO];
    }
}

```

EDIT

Whilst working on a new app, this method in a subclass of NSWindow was really convenient

```
- (void)setEnabled:(BOOL)enabled
{
    [self setEnabled:enabled view:self.window.contentView];
}

- (void)setEnabled:(BOOL)enabled view:(id)view
{
    if ([view isHidden]) return;

    for (NSView *item in [view subviews])
    {
        if ([item isKindOfClass:[NSProgressIndicator class]])
        {
            NSProgressIndicator *pI = (NSProgressIndicator *)item;
            [pI setHidden:enabled];
            if (!enabled) [pI startAnimation:nil];
            if (enabled) [pI stopAnimation:nil];
        }
        if ([item isKindOfClass:[NSTextField class]] || [item isKindOfClass:[NSButton class]] || [item isKindOfClass:[NSTextView class]])
        {
            [(id)item setEnabled:enabled];
            continue;
        }
        if (item.subviews.count)
        {
            [self setEnabled:enabled view:item];
        }
    }
}

```
**Since the first answer would still allow keyboard inputs,** I would make it **clean** and **walk trough each UI element in a loop and set it to disabled** in addition to make the window half visible. (Edit: mmackh's answer has the code to do this.)

Or you you use the easy way and simply add an invisible `NSView` on top of your window that is firstResponder and "catches" all inputs.