<!--
{
  "availability" : [
    "macOS: 10.6.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSWorkspace/showSearchResults(forQueryString:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSWorkspace(im)showSearchResultsForQueryString:"
  },
  "title" : "showSearchResults(forQueryString:)"
}
-->

# showSearchResults(forQueryString:)

Displays a Spotlight search results window in Finder for the specified query string.

```
func showSearchResults(forQueryString queryString: String) -> Bool
```

## Parameters

`queryString`

The string to search for.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the method communicated successfully with Finder; otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

Finder becomes the active app, if possible. The user can further refine the search via the Finder user interface.

You can safely call this method from any thread of your app.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)