How to run applescript on shutdown?

2.4k Views Asked by At

I am a total noob and new to mac osx so please be kind and patient :)

I want to be able to mute my MacbookPro (Yosemite) on shutdown, so I don't have to listen the bloody start-up chime, and then have have the volume go back to 50% at startup.

What I have done: I have created 2 AppleScripts that are saved as apps and do:

  1. Vol50.app - when I double click this app, my volume goes to 50%
  2. MuteVol.app - when I double click this app, my volume is muted

I was able to add 'Vol50.app' as a startup item, so it runs and works perfectly on startup.

My big challenge is getting the 'MuteVol.app' to work on shutdown.

I have looked at this post https://apple.stackexchange.com/questions/16825/make-a-script-app-run-on-logout

But I am really confused as to how to use the advice. Specifically how to use the logouthook advice and also how I would incorporate my 'MuteVol.app' into the plist.

I dont want to blindly copy and paste into terminal for the risk of doing something bad to my system.

Can someone kindly provide some suggestions and simple steps on how to use the logouthook?

Thanks so much.

1

There are 1 best solutions below

1
On BEST ANSWER

If you are after making you own just put your mute code at the top of the code they show on this site. Should do the trick you are looking for.

Shut Down Mac Using Applescript