Re: Announce the time every 30 minutes
On Dec 12, 2008, at 10:36 AM, has wrote: Mr. Gecko wrote: I'm trying to find out how to announce the time every 30 minutes, You could run 'say `date`' as a cron job. Interesting. The "speaker" translates "Fri Dec 12 17:52:58 PST 2008" into these spoken words: "free december twelfth seventeen hours fifty two minutes fifty eight seconds pee ess tee two thousand and eight" It gets everything correct except the day of the week abbreviation! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Announce the time every 30 minutes
On Dec 12, 2008, at 1:30 PM, Benjamin Dobson wrote: On 12 Dec 2008, at 18:36:21, has wrote: You could run 'say `date`' as a cron job. Make sure to specify your own date format. The user's default one will probably sound silly. For example, date "+The time now is %I:%m %p on %A %B %e %Y" will return The time now is 09:12 pm on Friday December 12 2008 The system voices will pick it up as a date and say "twelfth" instead of "twelve". Compare this with my default format: Fri 12 Dec 2008 21:27:14 GMT I had to listen to that several times to work out what it was saying. It is spoken ridiculously fast. See date man page for more info. Hi! A tiny bit of nitpickiness, if I may: When employing the above format string, one will probably want to use %M, rather than %m -- when I tried it, the %m returned the month, while %M returned the minutes. Cheers, Andrew smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Announce the time every 30 minutes
On 12 Dec 2008, at 18:36:21, has wrote: You could run 'say `date`' as a cron job. Make sure to specify your own date format. The user's default one will probably sound silly. For example, date "+The time now is %I:%m %p on %A %B %e %Y" will return The time now is 09:12 pm on Friday December 12 2008 The system voices will pick it up as a date and say "twelfth" instead of "twelve". Compare this with my default format: Fri 12 Dec 2008 21:27:14 GMT I had to listen to that several times to work out what it was saying. It is spoken ridiculously fast. See date man page for more info. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Announce the time every 30 minutes
Mr. Gecko wrote: I'm trying to find out how to announce the time every 30 minutes, You could run 'say `date`' as a cron job. HTH has -- Control AppleScriptable applications from Python, Ruby and ObjC: http://appscript.sourceforge.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Announce the time every 30 minutes
On 11 Dec 08, at 23:59, Mr. Gecko wrote: Does mac os x have some sort of a event sent out every 30 minutes? No, it does not. You can create one yourself with a timer, though. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Announce the time every 30 minutes
Does mac os x have some sort of a event sent out every 30 minutes? On Dec 11, 2008, at 5:49 PM, Andrew Farmer wrote: On 11 Dec 08, at 15:14, Mr. Gecko wrote: Hell I'm trying to find out how to announce the time every 30 minutes, I'm guessing I have to do it with NSTimer and and than have the time interval set to NSDate interval from now to the time which is like 7:30 or 8:00. but I'm not sure. That's correct - you will need to figure out the next time you want to make an announcement, given the current time, and calculate how far in the future that is. Keep in mind that NSTimers don't guarantee exact timing; they may fire slightly before or significantly after the target date. (In other words, be careful about handling "missed" announcements, especially in cases such as the computer going to sleep or the user adjusting the time or time zone.) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Announce the time every 30 minutes
I am working on an application that would most likely be on all the time because it does lots of useful things, the time announcement would just be an add on. On Dec 11, 2008, at 6:07 PM, M Pulis wrote: If you don't "need" this function "in" your app, or don't want to have your app running all the time just to do the chime, you could setup system preferences to let OSX do it for you. There may even be a command line that can be executed under control of your app. Gary On Dec 11, 2008, at 4:49 PM, Andrew Farmer wrote: On 11 Dec 08, at 15:14, Mr. Gecko wrote: Hell I'm trying to find out how to announce the time every 30 minutes, I'm guessing I have to do it with NSTimer and and than have the time interval set to NSDate interval from now to the time which is like 7:30 or 8:00. but I'm not sure. That's correct - you will need to figure out the next time you want to make an announcement, given the current time, and calculate how far in the future that is. Keep in mind that NSTimers don't guarantee exact timing; they may fire slightly before or significantly after the target date. (In other words, be careful about handling "missed" announcements, especially in cases such as the computer going to sleep or the user adjusting the time or time zone.) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/toothpic%40fastq.com This email sent to tooth...@fastq.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Announce the time every 30 minutes
If you don't "need" this function "in" your app, or don't want to have your app running all the time just to do the chime, you could setup system preferences to let OSX do it for you. There may even be a command line that can be executed under control of your app. Gary On Dec 11, 2008, at 4:49 PM, Andrew Farmer wrote: On 11 Dec 08, at 15:14, Mr. Gecko wrote: Hell I'm trying to find out how to announce the time every 30 minutes, I'm guessing I have to do it with NSTimer and and than have the time interval set to NSDate interval from now to the time which is like 7:30 or 8:00. but I'm not sure. That's correct - you will need to figure out the next time you want to make an announcement, given the current time, and calculate how far in the future that is. Keep in mind that NSTimers don't guarantee exact timing; they may fire slightly before or significantly after the target date. (In other words, be careful about handling "missed" announcements, especially in cases such as the computer going to sleep or the user adjusting the time or time zone.) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/toothpic%40fastq.com This email sent to tooth...@fastq.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Announce the time every 30 minutes
On 11 Dec 08, at 15:14, Mr. Gecko wrote: Hell I'm trying to find out how to announce the time every 30 minutes, I'm guessing I have to do it with NSTimer and and than have the time interval set to NSDate interval from now to the time which is like 7:30 or 8:00. but I'm not sure. That's correct - you will need to figure out the next time you want to make an announcement, given the current time, and calculate how far in the future that is. Keep in mind that NSTimers don't guarantee exact timing; they may fire slightly before or significantly after the target date. (In other words, be careful about handling "missed" announcements, especially in cases such as the computer going to sleep or the user adjusting the time or time zone.) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Announce the time every 30 minutes
Hell I'm trying to find out how to announce the time every 30 minutes, I'm guessing I have to do it with NSTimer and and than have the time interval set to NSDate interval from now to the time which is like 7:30 or 8:00. but I'm not sure. Thanks for the help, Mr. Gecko ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com