1

我有一个applescript,它可以检查我连接到我的计算机的几个外部HD 之一,并对它们的内容进行索引。所有硬盘都遵循命名方案 HK_12345,其中前两个字母始终相同,但每个驱动器的数字不同。我希望脚本只检查带有“HK”名称的驱动器,而不管结尾数字如何。我有这个,但它不工作。有什么建议吗?

set folderContains to "HK_"

tell application "Finder"
    set triggerFolder to folder whose name contains folderContains
end tell

tell application "Finder"
    if folder triggerFolder exists then
    -- some other code
    end if
end tell
4

1 回答 1

1

你应该检查disksnot folders

set diskContains to "HK_"

tell application "Finder"
    set selectedDisks to disks whose name contains diskContains
    -- some other code
end tell
于 2013-07-03T21:28:18.727 回答