【发布时间】:2013-11-24 18:53:51
【问题描述】:
我的 PDF 查看器是 Skim.app,我使用下面的一段 applescript 代码要求它从磁盘重新读取所有打开的文档,我需要让它经常这样做。问题是 Skim.app 有点错误,在很多方面。它的一个错误是,当它重新加载现有文档时,它会有点乱码。幸运的是,一次缩放和一次取消缩放修复了乱码,但必须手动执行非常烦人。
缩放按钮在菜单项“PDF”->“放大”,取消缩放为“PDF”->“缩小”。每次运行时都可以让applescript代码为我进行缩放和取消缩放吗?如果有怎么办?
#!/bin/bash
/usr/bin/osascript << EOF
set theFile to POSIX file "$1" as alias
set thePath to POSIX path of theFile
tell application "Skim"
activate
set theDocs to get documents whose path is thePath
try
if (count of theDocs) > 0 then revert theDocs
end try
open theFile
end tell
EOF
【问题讨论】:
标签: macos applescript