Hi Ian,
keystroke "v" using {option shift command down}
I think I got that right. Anyway the equivalent of this:
That's exactly it! I expecting to see Yellowbox scripts any day now!
The original script upthread dates from Numbers 3.0 days when all one could do was "GUI scripting" like this. Now that Numbers 3 has more sophisticated AppleScript support, purists might prefer a more "native" solution. But I've found the paste clipboard approach more efficient.
Interestingly, one can add a date-time stamp like this to almost any application on the Mac. If the application doesn't have Paste and Match Style then the following will usually get the job done:
keystroke "v" usingcommand down
A list of date and time formats that can be produced (the script used +%H:%M) are listed when typing 'man date' in Terminal (the man I think stands for "manual"):
cc Century (either 19 or 20) prepended to the abbreviated
year.
yy Year in abbreviated form (e.g., 89 for 1989, 06 for 2006).
mm Numeric month, a number from 1 to 12.
dd Day, a number from 1 to 31.
HH Hour, a number from 0 to 23.
MM Minutes, a number from 0 to 59.
ss Seconds, a number from 0 to 61 (59 plus a maximum of two
leap seconds).
Everything but the minutes is optional.
That seems to leave out some of the options. And some of the options, such as cc, don't produce the expected result on my machine.
But a little experimentation helps. If you wanted, say, to insert the date string formatted as 2014-05-30 then you could use:
do shell script "date +%Y-%m-%d"
SG