selectFile(_:inFileViewerRootedAtPath:)
Selects the file at the specified path.
Declaration
func selectFile(_ fullPath: String?, inFileViewerRootedAtPath rootFullPath: String) -> BoolParameters
- fullPath:
The full path of the file to select.
- rootFullPath:
The path to use for the file viewer. If you specify a nonempty path string, this method opens a new file viewer. If you specify an empty string (
@""), this method selects the file in the main viewer.
Return Value
true if the file was successfully selected; otherwise, false.
Discussion
In macOS 10.5 and later, this method does not follow symlinks when selecting the file. If the fullPath parameter contains any symlinks, this method selects the symlink instead of the file it targets. If you want to select the target file, use the resolvingSymlinksInPath method to resolve any symlinks before calling this method.
You can safely call this method from any thread of your app.