Hi Jim, Dannie, Sarah, and Others,

I had a long discussion about constructing a "say time" AppleScript and using the 24 hour clock on another list last year, and can summarize a few points that apply to this script, and also ways to get the time announced under Leopard and Tiger. The time format used is set by your selection under the "Formats" tab of the International menu under System Preferences. If you go to the clock on your status menu bar (either use Control-F8 or VO-M twice to navigate there, then use Left or Right arrow keys to move to the clock), arrow down to "Open Date & Time…" and press return, you'll find a button at the bottom of the "Date & Time" pane after the phrase, "To set date and time formats, use International preferences.", labeled "Open International". Pressing this button (VO-Space) will open the International Menu. Navigate (VO-RIght arrow) to the "Formats" tab and select it (VO-Space). The format for dates, time, numbers, and currency is generally specified by your region. Places like the U.S., Canada, Australia, and New Zealand have A.M. and P.M., by default. I think that only countries in Europe, like the U.K., or Ireland, use the 24-hour time format by default.

Once you choose your Region by pressing (VO-Space) the pop up button for the first selection, you specify the default settings for date, time, numbers (your currency symbol and the symbol you use to separate thousands, etc.), currency, and measurement units (metric or "US"). To change the default format setting for the date or time category you need to press the "Customize" button in that category. The problem is that the instructions tell you to drag and drop your format preferences to the field if you want your time to be reported as 19 28 instead of "7:28 PM", for example. So what I had to do was copy a default format that appeared in the time field of the customize menu when the U.K. region is chosen into the time field for the customize menu when the U.S. region is chosen. Delete the time entry format that's in the field before you paste. Once you do that, the pop up button for your Region will show a "Custom" entry that you can select. If you simply select a different region, you get the wrong default currencies, etc. As an aside, this probably applies to settings on the iPhone, iPod Touch, and the iPad (when it arrives), too. I set my iPod Touch to use an Australian voice by selecting that region under Settings, but it affects the default format for phone number entries I input directly into Contacts on that device rather than syncing from my Mac's Address Book.

The basic command these scripts use is the unix "say" command. If you open terminal (Command-Shift-U to the Utilities folder, press "T e" for Terminal, and Command-Down arrow to open), you can type in the word "say" (without quotation marks), followed either by a word, or a phrase enclosed in quotation marks, and when you press return, you'll hear that word or phrase spoken in the default text-to-speech voice. Unix also has a "date" command. When you type "date" in terminal, (without quotation marks, and followed by a carriage return), the current date and time will be returned, in the format specified for your region. The AppleScript that Jim attached is just parsing the system variable for the date (and time), which is represented by the variable "current date", into the bits that the author wants to use.

The other thing that can be helpful is to add a command like:

delay 0.5

before the "say" command to give VoiceOver a chance to stop speaking its last phrase. (You can make the interval longer by increasing the number of seconds in the argument.)

The Mac lets you assign a keyboard shortcut to commands or AppleScripts. In Snow Leopard, this is facilitated with Keyboard Commander, but this can be done in any version of OS X by using the Keyboard Shortcuts tab of the Keyboard & Mouse menu under System Preferences. I suspect that the date and time script that is being used for Snow Leopard is a variant of the "Current Date & Time.scpt" script supplied in the sample AppleScripts under the /Library/Scripts/ folder. Users with older versions of OS X (e.g., Leopard or Tiger), should be able to open Finder and use the Command-Shift-G "Go to Folder" shortcut to find this file. Type or paste in:
/Library/Scripts/Info Scripts
into the text field after using the Command-Shift-G shortcut, then press return. Open the script in the AppleScript Editor with Command- Down arrow and run it with Command-R.

Another easy way to run AppleScripts is to use a program like Spark to assign a keyboard shortcut. This is what many early VoiceOver users did using Travis Siegels "saytime" AppleScript that you can download from his Softcon page:

http://www.softcon.com/mac/

The "saytime" script is on the scripts page and Spark is on the page for compatible Mac programs. (Note that this script was written assuming a default time setup that was NOT configured for a 24-hour clock -- this is the way that Macs come if you do not configure the International menu format setups.) When you run Spark, go to the File menu and arrow down to the "New Hotkey" option, then right arrow to choose "AppleScript" for the type of Hotkey assignment. You'll be able to paste in an AppleScript, assign a name, and select a shortcut hotkey sequence under Spark. This can be easier for new users to use (especially on the older versions of Mac OS X), because shortcut key assignments have to be made when the app in question is NOT running. (This is because they're defined in the preferences file for each app, and this gets overwritten with current definitions each time you quit an application.) System-wide shortcuts would require a restart. Spark uses its own demon to run the assignments, so it's simple to set up.

HTH

Cheers,

Esther



Jim Gatteys wrote:

Dannie!
I was looking at time scripts and found parts of other scripts that were pieced together from the net--but they were just chunks from other scripts. It seems to run a bit faster than the apple time script but I'll have to admit I don't understand its reasoning and how it works. I did test it and I'll attach it here. I didn't write, just pieced together stuff that seemed to work.
Jim

Daniel Rowe wrote:

Hi
That folder seems to be missing unless it's hidden.
Dannie


-----
Find me on facebook or:
Skype: jimintexas
Yahoo or Aim/Ichat: jgatteys
Msn: [email protected]

<time script.scpt>--

--
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/macvisionaries?hl=en.

Reply via email to