我试过这个,但它不起作用:
tell application "Preview"
set myfile to path of document 1 of window 1
end tell
Run Code Online (Sandbox Code Playgroud)
我已经验证我的预览是可编写脚本的(NSAppleScriptEnabled).
我做了一点研究,发现了这一点
tell application "System Events"
tell process "Preview"
set thefile to value of attribute "AXDocument" of window 1
end tell
end tell
-- macos comes with php installed you can decode this file name using php
return do shell script "php -r 'echo urldecode(\"" & thefile & "\");'"
Run Code Online (Sandbox Code Playgroud)
我在macscripter上找到了
| 归档时间: |
|
| 查看次数: |
1614 次 |
| 最近记录: |