我试图在文件夹中显示相同大小的项目,我只是测试了以下代码,但我不断收到此错误:
error "Finder got an error: Can’t get some file of alias \"Macintosh HD:Temp to be Listened to:Temp:Short Temp (Small Files, <20mb):New Folder With Items:\" whose size = \"8890814\" and not 64."
你知道我怎么能让Finder显示一个文件,该文件与同一文件夹中的另一个文件的大小完全相同(但名称不同)?这是我提出的代码:
tell application "Finder"
set theFolder to choose folder
set noofFiles to number of files in folder theFolder as text
get some file of theFolder
set theFile to result
print result
display notification name of theFile as text
delay 1
get size of theFile as text
set theSize to result
get (some file of theFolder whose size is equal to theSize and name does not contain theFile)
reveal the result
end tell
由于
塔迪
答案 0 :(得分:1)
您无法将Finder文件说明符(theFile
)与字符串(name
)进行比较
set fileName to name of theFile
get (some file of theFolder whose size is equal to theSize and name does not contain fileName).
旁注:始终使用result
是危险的。它始终包含前一行的结果。如果该行没有结果,则它什么都不包含。