我是一个非常好的applescripter,并希望得到一些帮助。我正在制作一个类似于 Windows XP 回收站的回收站应用程序。它当然是一个水滴。当我将项目放到应用程序上时,应用程序会启动一个子例程,用于检查是否超出了回收站(垃圾箱)的大小限制。但是,当我尝试获取垃圾箱中项目的信息时,出现的错误消息是:“Finder 出错。找不到文件项目 1。” 我真的需要帮助:(子程序如下:
on check()
tell application "Finder"
set the total_size to 0
set the trash_items to get every item in trash
if the trash_items is not {} then
repeat with i from 1 to the count of items in trash
set this_info to get info for item i of trash --ERROR ON THIS LINE
set the total_size to the total_size + (size of this_info)
end repeat
try
set the second_value to the free_space / (RBPFMS / 100)
if the total_size is greater than the second_value then
display alert "Size Limit Exceeded" message "The Recycle Bin cannot receive any more items because it can only use " & RBPFMS as string & " of your hard drive." buttons {"OK"} default button 1
return false
else
return true
end if
on error
set RBP to ((path to startup disk) as string) & "Recycle Bin Properties"
display dialog "Error: You have modified the properties file for the Recycle Bin. Do not modify the properties file. It is there to store information that is used to determine the properties for the Recycle Bin." with title "Property File Modified" with icon 0 buttons {"OK"} default button 1
set the name of RBP to "DELETE ME"
error number -128
end try
end if
end tell
end check