Hi.
I am trying to write an AppleScript that empties my downloads folder. However, whenever I run the script, I get the dialog box, but then I get this error: "Finder got an error: Can't get folder "Downloads" of folder "Home".
The script is as follows:
There is defiantly a folder called "Downloads" in my home folder. Is there something wrong with my code?
Thanks.
I am trying to write an AppleScript that empties my downloads folder. However, whenever I run the script, I get the dialog box, but then I get this error: "Finder got an error: Can't get folder "Downloads" of folder "Home".
The script is as follows:
Code:
set userResponse to the button returned of (display dialog "Are you sure you want to empty your downloads folder?" buttons {"No", "Yes"} default button 2 with icon caution)
if userResponse is "Yes" then
tell application "Finder"
empty folder "Downloads" of the folder "Home"
end tell
end if
There is defiantly a folder called "Downloads" in my home folder. Is there something wrong with my code?
Thanks.