Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   Adjusting volume using applescript? (http://www.mac-forums.com/forums/os-x-development-darwin/48905-adjusting-volume-using-applescript.html)

PrimalYeti 01-02-2007 01:52 AM

Adjusting volume using applescript?
 
Hey everyone;

Ok, ill start of by saying i'm a complete newb when it comes to scripting using applescript. I want a script, or something, that will turn my my volume to zero whenever I turn my mac off.

Anyhelp?

NanoBite 01-02-2007 03:00 AM

Is this anything to do with the startup chime?

I can't write Applescripts but you would need one for shutdown and another for startup. Another alternative is to have a plug in the headphone jack which would keep your MacBook Pro quiet at startup.

PrimalYeti 01-02-2007 04:21 AM

Quote:

Originally Posted by Pulse-8 (Post 297320)
Is this anything to do with the startup chime?

I can't write Applescripts but you would need one for shutdown and another for startup. Another alternative is to have a plug in the headphone jack which would keep your MacBook Pro quiet at startup.

I want a script to do it though, i dont want to have to buy a headphone plug

puaerotch 01-02-2007 12:29 PM

I'm not sure how to get it the script to run on shut down so this script sets the volume to mute then starts the shut down process.
Code:

set volume with output muted

tell application "Finder" to shut down

Alternatively, there is a preference pane available that supposedly does what you are asking for. I haven't used it so I can't give you a review but I thought you might want to take a look at it.
http://www.versiontracker.com/dyn/moreinfo/macosx/23141

xstep 01-03-2007 05:03 AM

To mute the volume during shutdown you could try this method which works on my G4 tower. I don't have the time to test it on my Intel right now.

Unix has special scripts that get executed during startup and shutdown. As a safeguard the system also looks for custom 'local' scripts named rc.local and rc.shutdown.local in the Unix directory /etc.

In the shutdown script place
osascript -e "set volume with output muted"

In the startup script place
osascript -e "set volume without output muted"

That startup script will restore your volume to what it was before you muted on shutdown, but after the startup chime would have sounded. In other words, this gets you silent startups.

You'll need sudo (admin) privilege to create or alter the files. Search the forums if you don't know what that is.


All times are GMT -4. The time now is 01:43 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.