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.
有没有办法使用 AppleScript(或其他东西)来查询当前正在运行的应用程序以获取它们打开的当前文件的文件名和路径?我知道一些应用程序会在窗口标题中显示文件名,这是可以通过脚本访问的,但这并不是一个解决方案,因为并非所有应用程序都这样做,而且几乎没有显示路径。我也知道这很复杂,因为并非每个应用程序都是基于文档的。
任何有关如何在运行的 Mac 应用程序中查找当前打开的文件/路径的建议将不胜感激。谢谢!
http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/lsof.8.html