• 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: Syntax for current date - Need help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Syntax for current date - Need help


  • Subject: Re: Syntax for current date - Need help
  • From: Clark Martin <email@hidden>
  • Date: Thu, 7 Apr 2005 10:03:33 -0800

At 6:51 PM +0200 4/7/05, Axel Luttgens wrote:
Bernardo Hoehl wrote:

Hi List!


I want to manage the users of a Mac, and stop them from using unauthorized applications during work time (between 09:00 and 17:00).


But I want to allow them to use these apps after work time.

I will declare a variable containning a list of forbiden applications, and check time of current date (if greater than 09:00 or smaller than 17:00), check what apps are open, and kill the app if necessary.

My difficulty is regarding the "if" sintax for current date.

Could you comment my lines bellow? Are they currect?


Thank you,


Bernardo Höhl Rio de Janeiro - Brazil

set CurrentTime to time of (current date)

if CurrentTime > 32400 and CurrentTime < 61200 then


beep -- do something, kill whatever


end if

Just change the "and" into an "or".
Seems it would be more logical. ;-)

Then you could just substitute the whole thing with the constant "True" because it will always come out "True" if you use "or".


Now, for the code's legibility (you know, some months later), you could perhaps change "32400" into "9 * hours" and "61200" into "17 * hours" as well.


--
Clark Martin
Redwood City, CA, USA
Macintosh / Internet Consulting

"I'm a designated driver on the Information Super Highway"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Syntax for current date - Need help
      • From: Axel Luttgens <email@hidden>
References: 
 >Sintax for current date - Need help (From: Bernardo Hoehl <email@hidden>)
 >Re: Sintax for current date - Need help (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Sintax for current date - Need help
  • Next by Date: Re: Syntax for current date - Need help
  • Previous by thread: Re: Sintax for current date - Need help
  • Next by thread: Re: Syntax for current date - Need help
  • Index(es):
    • Date
    • Thread