Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Don't play system sound: applescript

When moving a file or folder, it plays a sound to notify you its been moved,copied, etc.


Is there a way to silence/stop that sound from playing via applescript?

Mac mini, Other OS, 10.8.3

Posted on Mar 28, 2014 2:04 PM

Reply
4 replies

Mar 30, 2014 1:03 PM in response to JoshFree

There's no command to shut off the Finder sound effects for one move (short of shutting off all sounds for that move and then turning it back on); it's all or nothing.


The command line command to move a file is mv. There will be no sound effects for files moved via mv.


Here's an example command sequence that moves to your login directory (the cd with no parameters), creates an empty file using the touch command, then renames and relocates that file using the mv command:

cd

touch name.tmp

mv name.tmp Downloads/newname.tmp


If you specify directory paths on the parameters to the mv command, then the file will be relocated. This example shows a relative (relative to the current directory) path specification with the Downloads/newname.tmp reference.


There are other options available including Python scripts — which are handy for some tasks, because Python can use the system frameworks via pyobjc bridging.


FWIW, unless I'm specifically scripting a GUI application that doesn't have a command interface or specifically dealing with Apple events, I generally prefer to avoid AppleScript. Scripting tools such as bash and Python can be good choices here. If you're interested in using or are otherwise fond of it, AppleScript can invoke bash commands or a bash shell script just fine — which would be one way to avoid the file-move sound effect.

Don't play system sound: applescript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.