-1

In the past, in Alfred we could bind a hotkey to a selected file, and it would return to the path of the file: enter image description here enter image description here

After upgrading to Mac Big Sur, it now returns empty string:

enter image description here

Why does this happen, and how to recover the original behaviour?

WurmD
  • 1,231
  • 5
  • 21
  • 42

1 Answers1

0

But I have found a new method to fix this problem. The code is as follows:

    #! /bin/bash

CurrentSelectPath=$(osascript <<EOF
tell application "Finder"
    set theItems to selection
    set filePath to (POSIX path of (the selection as alias))
  end tell
  set q to filePath
  return q
EOF
)
echo $CurrentSelectPath
  • Later, I searched Alfred's official forum and found that it was a permission problem. Just check Alfred in Preferences > Security and privacy > accessibility ☑️ It may be that MacOS Big Sur pays more attention to privacy – CoderWGB Jan 21 '22 at 11:17