Applescript Dialog Box not going away after Big Sur

Nov 23, 2020
Reaction score
I have a Folder Action Script that I cobbled together while back that monitors when a USB drive is attached, then looks for a shell script on that drive and runs it if I tell the Folder Action Script "Yes". If I click "No" it closes out the dialog and all is well.

It still works at the heart of things, however now when I click "Yes" the dialog box stays visible until the shell script completes, whereas in the past it would disappear immediately after clicking "yes" or "No".

Any help is greatly appreciated, and thanks in advance!


property dialog_timeout : 60

on adding folder items to this_folder after receiving added_items
set shFiles to {}
repeat with current_item in added_items
set end of shFiles to ((current_item as text) & "") as alias -- check if "" exists
end try
end repeat
if shFiles is not {} then
tell application "Finder" to set the folder_name to the name of this_folder
-- find out how many
set the item_count to count shFiles
--create the alert string
set alert_message to ("External Drive Attached" & return & return) as Unicode text
if the item_count is greater than 1 then
set alert_message to alert_message & (the item_count as text) & " new drives have "
set alert_message to alert_message & "One new drive has "
end if
set alert_message to alert_message & "been attached, in folder " & «data utxt201C» & the folder_name & «data utxt201D» & "."
set the alert_message to (the alert_message & return & return & "Would you like to run Autosync?")
display dialog the alert_message buttons {"Yes", "No"} default button 2 with icon 1 giving up after dialog_timeout
set the user_choice to the button returned of the result
if user_choice is "Yes" then
repeat with shFile in shFiles
do shell script quoted form of POSIX path of shFile
end try
end repeat
end if
end if
end adding folder items to

Cory Cooper

May 19, 2004
Reaction score
Hello and welcome.

I am not very experienced with scripting. Sounds like there may have been some change in Big Sur that is affecting it. Maybe another member here with more experience will chime in, or you could try the folks over at MacScripter.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question