Applescript检查文件夹是否为true

Applescript检查文件夹是否为true,applescript,Applescript,在下面的脚本中,我试图通过检查来确定输入的路径是否指向文件夹: folder of file_info -> should return true/false 但在尝试此操作时,脚本会给出错误并停止 但其他价值观也很管用,例如: size of file_info -> return size incase of folder its "missing value" 有人知道为什么这不管用吗?我见过其他脚本,人们使用它,但似乎没有人得到这个错误 on log_event(them

在下面的脚本中,我试图通过检查来确定输入的路径是否指向文件夹:

folder of file_info -> should return true/false
但在尝试此操作时,脚本会给出错误并停止

但其他价值观也很管用,例如:

size of file_info -> return size incase of folder its "missing value"
有人知道为什么这不管用吗?我见过其他脚本,人们使用它,但似乎没有人得到这个错误

on log_event(themessage)
            set theLine to (do shell script "date  +'%Y-%m-%d %H:%M:%S'" as string) & " " & themessage
            do shell script "echo " & theLine & " >> ~/Library/Logs/tvshowscript-events-test.log"
        end log_event

        tell application "Finder"

            set str to "Macintosh HD:Users:"

            set the_item to str as alias

            set file_info to get info for the_item

            my log_event("-------------- " & size of the file_info)
            my log_event("-------------- " & kind of the file_info)
            my log_event("-------------- " & folder of the file_info)   

        end tell

尝试删除行
tell应用程序“Finder”
end tell

谢谢你的工作:)现在要解决这个XD,糟糕的是,你甚至不能调用tell Finder中的方法来获取值