• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shut down computer running 10.1.3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shut down computer running 10.1.3


  • Subject: Re: Shut down computer running 10.1.3
  • From: "Arthur J. Knapp" <email@hidden>
  • Date: Mon, 16 Sep 2002 12:25:46 -0400

> Date: Sun, 15 Sep 2002 02:29:59 -0400
> Subject: Re: Shut down computer running 10.1.3
> From: brian mather <email@hidden>

> on idle
> set now to (current date) as string
> set the_hour to word 5 of now
> set am_pm to word 8 of now
> set right_now to the_hour & am_pm
> if right_now = "10PM" then
> tell application "Finder"
> shut down
> end tell
> end if
> return 3600
> end idle

set now to current date

set the_hour to time of now --> seconds since midnight

(* 1. You want to use the ">" symbol. Checking the
* seconds since midnight with "=" will only work
* if it is exactly 10, which cannot be guarenteed.
*
* 2. ( 10 + 12 ) == 10PM
*)
if (the_hour > (60 * 60 * (10 + 12))) then `
tell application "Finder" to shut down


Good things to know:

set dateObject to current date

set secondsOfDay to time of dateObject --> seconds since midnight
secondsOfDay div 60 div 60 --> hour
secondsOfDay div 60 mod 60 --> minutes
secondsOfDay mod 60 -- --> seconds


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: script error on every other Mac?
  • Next by Date: RE: OK, so who broke /usr/bin/AppleSystemProfiler?
  • Previous by thread: Re: Shut down computer running 10.1.3
  • Next by thread: Re: AppleWorks - every record whose visible is true
  • Index(es):
    • Date
    • Thread