Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
过去,在 Alfred 中,我们可以将热键绑定到选定的文件,然后它会返回到文件的路径:
升级到 Mac Big Sur 后,它现在返回空字符串:
为什么会发生这种情况,以及如何恢复原始行为?
但我找到了解决这个问题的新方法。代码如下:
#! /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