Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

skd

macrumors 6502
Original poster
Aug 27, 2006
254
0
carmel, ca
"I set it to fade out over a period of two hours, then sleep my MBP (connected to hifi) when I go to sleep. It then wakes up at 6 am every week day and plays my 'wake up playlist', fading in over a period of 10 minutes. :p I love my Mac."
I saw this on another thread......can someone eplain how I can get my mac to do this?
thanks
 
Ok here we go this is a bit of a mix between some Automator action and Applescript but I will show you everything so no need to worry.
Note: If you are not using OS 10.4 (Tiger) then this solution will not work for you!

I will focus on starting up your Mac in the morning and having it fade in slowly for however long of time you want (I'll do 10 minutes as you asked).

Ok open up Automator you will have 3 columns, the Library, the Actions, and the Workflow area. I will describe how to build the workflow by saying the names of each column (iTunes, Volume, Set to 0) means choose iTunes from the Library, find the Volume Action, and set that action to 0 in the workflow.

Ok it's for real now.
iTunes: Set iTunes Volume: Set volume to 0
iTunes: Get Specified iTunes Items: Click the + and select the Playlist you want.
iTunes: Start iTunes Playing: No setting.
Automator: Run Applescript: (copy the following code into the Applescript workflow box):
Code:
tell application "iTunes"
	set sound_level to 100
	set sound volume to 0
	play
	repeat while sound volume < sound_level
		set sound volume to sound volume + 5 --Set increment of Volume
		delay 120 --Set increment of time for how often Volume is increased
	end repeat
end tell

Now you are all done. You will notice the comments in the applescript code. The +5 is saying the volume will increase that much (out of 100) and the Delay is the amount of time (in seconds) in between each volume increase. So take 10 minutes (600 seconds) and divide by 5 (volume increment) and you get 120, and this is what the delay is set to. You can adjust this as you see fit.
Oh, and when you save the workflow save it as an Application and then go to System Preferences>Login Items and select your new Automator program. Then you'll need to tell your Mac to turn on every weekday (Energy Saver Preferences).
 
-skd

Or you can try calling a script from your iCal for the wakeup.

1. Write a script to fade the music over a given time using something like:

tell application "finder"
set volume 8
launch application "iTunes"
tell application "iTunes"
play the playlist "GOTOSLEEP"
delay 120
set volume 7.5
delay 120
set volume 7
delay 120
set volume 6.5
delay 120
set volume 6
delay 120
set volume 5.5
delay 120
set volume 5
delay 120
set volume 4.5
delay 120
set volume 4
delay 120
set volume 3.5
delay 120
set volume 3
delay 120
set volume 2.5
delay 120
set volume 2
delay 120
set volume 1.5
delay 120
set volume 1
delay 120
tell application "iTunes" to quit
End tell
End tell
end tell


2. Write a script for iCal to open at an apponted time...

tell application "finder"
set volume 8
launch application "iTunes"
tell application "iTunes"
play the playlist "GOODMORNING"
End tell
end tell


Disclaimer: I put these together off the cuff - haven't compiled. there may have been something I miised like a tell or end tell.
 
skd said:
How do I get to the moon?
So did my solution get you to the moon? Or were you scared off by it? I tried it this morning, worked fine.

Oh, and Patrick, try a loop to change the volume increments. All that code is confusing.
 
thanks

GS12
Having never done anything like this I didn't think I would be sucessful. But, it worked!! I'm an architect and spend most of my time using my computer to produce drawings. I just made the switch to mac at the beginning of the year and continue to be impressed with the mac and it's community. How did you learn this? Again thanks.
 
skd said:
GS12
Having never done anything like this I didn't think I would be sucessful. But, it worked!! I'm an architect and spend most of my time using my computer to produce drawings. I just made the switch to mac at the beginning of the year and continue to be impressed with the mac and it's community. How did you learn this? Again thanks.
I learned most of the Automator stuff through interest (it isn't easy, yet not too hard). And the AppleScript stuff I am still learning, but basic stuff is no problem.

Also I taught myself this stuff out of the monotony of not wanting to actually do it myself. There is a lot of power in a computer if you can get automation scripts to work for you. Brings back that bit of computer magic.

I'm glad it worked for you. Now you wanna build me a house?
 
GimmeSlack12 said:
So did my solution get you to the moon? Or were you scared off by it? I tried it this morning, worked fine.

Oh, and Patrick, try a loop to change the volume increments. All that code is confusing.

-GimmeSlack12

Yeah, thought of that later, this was the best I could do from memory in a pinch.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.