General Question

aubreyway's avatar

How can applescript be used to insert a YY.MM.DD date stamp?

Asked by aubreyway (1points) April 13th, 2010

How can applescript be used to insert a YY.MM.DD date stamp?

Observing members: 0 Composing members: 0

1 Answer

jrpowell's avatar

Here is a quick and dirty that will post the date to the clipboard. It will notify you first so it so you don’t accidentally overwrite what is on the clipboard. Just hit enter and it is on your clipboard.

set the date_stamp to do shell script “date ’+%Y.%m.%d’”
display dialog the date_stamp buttons {“Dimsiss”, “Clipboard”} default button 2
if the button returned of the result is “Clipboard” then
set the clipboard to the date_stamp
end if

Note that Fluther will make the quotes curly so you will need to straighten them out of the script will shoot you an error.

edit :: “default button 2” should be on the same line. The formatting here is shitty for code. And this doesn’t get exactly what you want. But it is a start and I am drunk and tired and haven’t touched applescript in a while.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther