0

The simplest code doesn't work in Mac OS X 10.14. XCode 10.2.1 (10E1001).

Application is not sandboxed. Main window has only one push button. When button is clicked following method is called:

    - (IBAction)clicked:(id)sender
{
    NSString *stringToSearch = @"iWorks";
    NSLog(@"Button clicked -- %@", stringToSearch);

    BOOL opened = [[NSWorkspace sharedWorkspace] showSearchResultsForQueryString:stringToSearch];
    NSLog(@"opened = %hhd", opened);

}

Returned :

2019-05-20 14:18:50.575867+0300 111[3224:448389] Button clicked -- iWorks
2019-05-20 14:18:50.576879+0300 111[3224:448389] opened = 1

But no Finder window is opened. May be I missed something obvious?

1 Answers1

0

I need just to add into info.plist

<key>NSAppleEventsUsageDescription</key>
<string>Please provide access
    to AppleEvents to ontrol Finder application</string>