I’m trying to bypass the annoying dialog box in iTunes when you want to delete something. However, the property is not being remembered, so even if you click “Don’t Prompt Again” it prompts you again. Anyone know why?
property confirm : true
tell application "iTunes"
set sel to selection
if confirm is true then set toContinue to button returned of (display dialog " WARNING:" & return & "This script will delete the selected file immediately, sending it to the trash. Since the point is to get rid of the dialog box, this will not appear again if you choose \"Don't Prompt Again\". You have been warned." buttons {"Cancel", "Don't Prompt Again", "Prompt Again"} with icon caution cancel button 1)
if toContinue is "Don't Prompt Again" then set confirm to false
repeat with toDelete in sel
set deleteFile to location of toDelete
tell application "Finder" to move deleteFile to trash
delete toDelete
end repeat
end tell