0

I have an NSDatePicker object (hours, minutes, and seconds only) in my Mac App. I have everything linked up, my only question is what is the AppleScript syntax to retrieve a date/string from a NSDatePicker object? I would like to then use the AppleScript keyword "say" to then speak the date selected. The AppleScript code is executed when a "Speak Date" button is pressed in my app GUI.

Thank you.

Best...SL

Skyler
  • 2,834
  • 5
  • 22
  • 34

1 Answers1

0

In your Cocoa app, try something like this:

NSAppleScript *script = [[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:@"say \"%@\"", [[yourDatePicker dateValue] description]]];
[script executeAndReturnError:nil];
Michele Percich
  • 1,872
  • 2
  • 14
  • 20