I have a script that deletes several items.
Every time an item is put in the trash I hear a sound.
How do I do this without sound?
I tried the following but it doesn’t work:
tell application "Finder"
delete file "Mac OSX:Users:XXX:Desktop:8ball.tif" without sound
end tell
That should work just fine, and remember that unless you reset the number to 70 or 80 later in the script, you will hear no alert beeps at all, in any application after the script has executed. I believe that whatever setting you choose will remain the default, even after the machine is shut down and re-started later.
You know, I havnt noticed yet, because the script I used it in placed it in a repeat. I think that is true though. I am not hearing the sound I muted within that app, but I hear it in other apps.
This should silently delete the current Finder selection - and then restore the previous volume setting:
tell application "Finder"
set v to alert volume of (get volume settings)
set volume alert volume 0
delete selection
set volume alert volume v
end tell
beep (* merely to demonstrate the restored volume *)
I just assumed you couldn’t get the current volume settings and that’s why the previous scripts didn’t contain the commands to get them.
It makes complete sense if you can set it, then you can also get it.
Thanks for the extra info.