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

bobright

macrumors 601
Original poster
Jun 29, 2010
4,817
34
Ahhh got like 3 hours left im transferring from External HD to External HD and I need to leave. It isnt so Fusion so going to take a while:confused::confused::mad:
 
I guess it's too late for this specific occasion, but for future reference I'll post it anyway. OK, this isn't the most refined method but since the copy process gives you the estimated time remaining it's not really necessary to code the script so that it checks whether the copying is done. Furthermore, this one can be used for any occasion where you want your Mac to shut down after a specific amount of time.

If you want your Mac to go to sleep instead, just replace "shut down" in the last line with "sleep".

Code:
display dialog "How many hours until desired shut-down time?" default answer "3"

set shutDownTime to (get current date) + ((text returned of result) as real) * 3600

repeat
	delay 5 * 60
	if (current date) > shutDownTime then exit repeat
end repeat

tell application "Finder" to shut down

Copy and paste this into an AppleScript Editor window and save it wherever you want, preferably as an application.
What it does is pretty self-explanatory, I think. :)

You can enter a decimal number into the prompt; just make sure you don't use colons since it expects a real number, not a time span separated in hours and minutes.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.