• 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: Manipulating System Clock
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Manipulating System Clock


  • Subject: Re: Manipulating System Clock
  • From: Zack Jarrett <email@hidden>
  • Date: Wed, 11 May 2011 14:00:30 -0700

In an AppleScript applet that I maintain I use the following construct:
do shell script "whatever" with administrator privileges

That can be run under a non-admin account but will present a dialog asking for an admin username and password.  Under an admin user account it will display the usual "type your password to allow the app to make changes" dialog.

Prompting for the username/password may not be the optimal solution.  Perhaps you can build that section into a try/catch and upon failure you can run the application in some mode that does not require a change to the date/time.

Good luck!

Zack


On May 11, 2011, at 1:28 PM, George wrote:

> 	do shell script "/usr/sbin/systemsetup -setdate 'mm:dd:yy' -settime 'hh:mm:ss'"
>
> But there's a problem for me.  You can use this trick only if the application is run under an administrative account.  In other words, you cannot manipulate the system clock in this manner if the app is run under the guest account or a standard account.  Are there simple alternatives such that the application can change the date and the time under a non-administrative account.  It's a problem for me because Mac App Store, according to Apple, requires that the app can run under non-administrative accounts.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Manipulating System Clock
      • From: Jim Thorton <email@hidden>
References: 
 >Manipulating System Clock (From: George <email@hidden>)

  • Prev by Date: Re: Manipulating System Clock
  • Next by Date: Re: Manipulating System Clock
  • Previous by thread: Re: Manipulating System Clock
  • Next by thread: Re: Manipulating System Clock
  • Index(es):
    • Date
    • Thread