0

I want to read the various Date and Time related values the user sets through system preference.The Clock tab of Date & Time settings various settings.enter image description here

Now i wan to read weather the user changed Time Options, want to detect if its enabled or not? and also want to get notification whenever user changes these settings?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Please be more specific. Read them how, notification how. what have you tried.. – markhunte Jun 27 '13 at 16:10
  • @markhunte :Kindly look at the updated question, and if you know any information kindly share – sandy Surname or Initialc Jun 28 '13 at 06:22
  • I understood what you wanted to read. But the picture helps. What anyone who decides to answer your question needs to know is How you want to be notified. Example Email,Pop up Dialogue, SMS, Log file. All are different and if I was going to help you I would not want to guess. Also when you say user it helps if you explain the relativity to them as a user and yourself. i.e you are an admin for a lab of Macs. and have remote access to the Machine.... The more details you add give someone a better chance of answering this question correctly – markhunte Jun 28 '13 at 06:52
  • All i have is a simple UI program which will display current date and time along with current user selected options.By notification i want to detect programatically when user changes the values so that i can change the time being displayed in UI accordingly. – sandy Surname or Initialc Jun 28 '13 at 11:11
  • Thanks. What is this UI program. Is it one you have written in Xcode.. Rather than me keep asking questions. Take a moment to go over what you have, what you want , what the situation is..and then Add this info to you Question. But before you actually add it re-read it and think of the questions it will raise and include that info in the Question. I am not trying to be condescending here. But it is a little like getting blood from a stone. Each tidbit of info is getting me or someone closer to helping you but I for one do not want to waste my time on doing it without all the variables. – markhunte Jun 28 '13 at 12:46

1 Answers1

1

Just to emphasise my point in my comments. This is how you can read the clocks preferences via objective-c;

 CFStringRef appID;
CFPropertyListRef newCP;

appID = CFSTR("com.apple.menuextra.clock");
CFStringRef Key = CFSTR("IsAnalog");
 newCP  = CFPreferencesCopyAppValue (
                                         Key,
                                          appID
                                             );

 NSLog(@" newCP %@", newCP);

or in Applescript:

set theClock to quoted form of (do shell script "read com.apple.menuextra.clock  IsAnalog ")

But without knowing more this maybe a pointless answer.

markhunte
  • 6,805
  • 2
  • 25
  • 44