开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜