【发布时间】:2017-12-04 16:48:34
【问题描述】:
我想让程序打开一个文件夹,然后显示一个文本来删除这个文件夹,但我无法让它工作。任何帮助表示赞赏。
on opening folder theResponse
tell application "Finder"
set theName to name of theResponse
activate
display alert "Attention!" message "The folder" & theName & " was opened."
set question to display dialog "Do you want to delete this folder?" buttons {"No", "Yes"} default button "No"
set answer to button returned of question
if answer is equal to "Yes" then
set sourceFolder to theName
move sourceFolder to the trash
end tell
end opening folder
【问题讨论】:
标签: macos applescript finder