开发者

Cocoa question: How to get file path for current open document for the front most application

开发者 https://www.devze.com 2023-03-05 03:26 出处:网络
I ca开发者_开发知识库n get the front most application, how do I get the path for the front most document?There isn\'t a way to do this for any app. Apps don\'t always have documents. If an app support

I ca开发者_开发知识库n get the front most application, how do I get the path for the front most document?


There isn't a way to do this for any app. Apps don't always have documents. If an app supports the standard AppleScript document model, you can do it with AppleScript. For example,

tell application "TextEdit"

    set foo to the path of the first document

end tell
0

精彩评论

暂无评论...
验证码 换一张
取 消