1

我对 Applescript 非常陌生,我编写了一个快速脚本,可以根据文件类型和修改日期打开一些文件/目录。任何修改后,我都需要在 iBooks 中打开这些文件。你能告诉我我的剧本有什么问题吗?

这是脚本:

set theFolder to alias "Macintosh HD:::"
tell application "iBooks"
open (file of theFolder whose name extension is "epub" and modification date is less than (current date))
end tell
4

1 回答 1

0

这应该这样做:

set theFolder to POSIX file "/Users/USER/Desktop/test_folder"
set theFolder to theFolder as alias
tell application "Finder"
    open theFolder
    set myList to (every file of theFolder whose modification date is less than (current date))
    set theApp to path to application "iBooks"
    repeat with myFile in myList
        open myFile using theApp
    end repeat
end tell

因为 iBooks 不可编写脚本,所以我告诉 Finder 使用 iBooks 打开文件。同时打开所有文件时遇到了一些麻烦。这应该是可能的,但我决定使用重复循环。在此示例中,假设所有文件都位于用户桌面上的文件夹 test_folder 中。

于 2013-12-03T22:29:26.327 回答