据我所知,用于更改文件名的标准 applescript 代码是:
set name of my_file to "New_Name"
但是当我在重复循环(由文件夹操作调用)中使用它时,我得到一个“堆栈溢出”错误。这是完整的代码:
on adding folder items to this_folder after receiving these_items
try
repeat with this_item in these_items
set name of this_item to "New_Name"
end repeat
on error error_message number error_number
display dialog error_message buttons {"Cancel"} default button 1
end try
end adding folder items to
有没有人遇到过这个问题?会不会跟山狮有关系?