diff --git a/CHANGELOG.md b/CHANGELOG.md index 915a136fb..7f06fb7d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Version counting is based on semantic versioning (Major.Feature.Patch) * Add funtion to open the library root location. * Add a help dialog for the search engine. Use the drop down menu in the search field. * Add quick search presets. Use the drop down menu in the search field. +* Fix `open containing folder` asking for permission to control Finder on macOS. ### YACReaderLibraryServer * Add the `repair-library` command to restore missing covers and rescan files that previously failed to be added. diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index 12137cc20..49f0ebf7e 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -2694,17 +2694,12 @@ void LibraryWindow::openContainingFolderComic() #endif #ifdef Q_OS_MACOS - QString filePath = file.absoluteFilePath(); + // `open -R` reveals and selects the file in Finder without sending an Apple + // Event, so it doesn't trigger the macOS automation permission prompt. QStringList args; - args << "-e"; - args << "tell application \"Finder\""; - args << "-e"; - args << "activate"; - args << "-e"; - args << "select POSIX file \"" + filePath + "\""; - args << "-e"; - args << "end tell"; - QProcess::startDetached("osascript", args); + args << "-R"; + args << file.absoluteFilePath(); + QProcess::startDetached("open", args); #endif #ifdef Q_OS_WIN