I am brand new to the world of Apple Macs. Just now getting into my new Mac Pro.
One of the really neat applications that I used all the time on my PC was a calendar program that replaced the MS date/time application. I could mouse click the current date in the lower right screen of my PC & then paste the current date & time in ANY email, Word doc, spreadsheet that I wanted. The stamp was completely configurable.
I have not found anything like that on the Mac side of things so I thought an Applescript might do the job.
Can someone direct me to a script I could use or a site that I could search for that type of script?
There’s an application called MenuCalendarClock that does that (approximately). It would be easy to put the current date and/or time into the clipboard from an AppleScript, but not so easy to make it user-configurable. If you’ll show us the format(s) [one or two] you’d like to have, I’m sure someone will whip something up or perhaps even has something.
Here’s the one I use in YY/MM/DD hr:min:sec format which sorts correctly. [Nigel Garvey and/or Kai Edwards derived, can’t recall].
to makeStamp(Now, DelimD, DelimT) -- the first delim for date, the second for time.
tell Now to tell 100000000 + day * 1000000 + (its month) * 10000 + year as string ¬
to set dateStamp to text -2 thru -1 & DelimD & text 4 thru 5 & DelimD & text 2 thru 3
tell Now to tell ((1000000 + (its hours) * 10000 + (its minutes) * 100 + (its seconds)) as string) ¬
to set timeStamp to text 2 thru 3 & DelimT & text 4 thru 5 & DelimT & text 6 thru 7
return dateStamp & " " & timeStamp
end makeStamp
set the clipboard to makeStamp((current date), "/", ":")
--> 07/05/17 20:09:27 will be in the clipboard
Click the link at the top of the script box that says “Open this Script in your Script Editor” and with your permission it will automagically appear in your Script Editor. Then click compile, click run and paste somewhere. After you’ve compiled it the first time and tried it, you can save it as an Application (bottom of the save page) with none of the check boxes checked. Every time you run it (by double-clicking it or starting it from the dock), the time stamp will appear in the clipboard.
If you prefer not to have the time appended, this version just returns, eg: “2007/05/17”
-- From script by Kai Edwards
tell (current date) to tell 100000000 + day * 1000000 + (its month) * 10000 + year as string ¬
to set D to (text -4 thru -1 & "/" & text 4 thru 5 & "/" & text 2 thru 3)
set the clipboard to D
If you want the whole enchilada, here’s Apple’s version:
set the date_stamp to ((the current date) as string)
display dialog the date_stamp buttons {"Clipboard", "OK"} default button 2
if the button returned of the result is "Clipboard" then
set the clipboard to the date_stamp
display dialog "The date stamp is on the clipboard." buttons {"¢"} giving up after 2 default button 1
end if
Rather than run a script application, if you poke around in /Library/Scripts or ~/Library/Scripts you’ll find a script to show the Scripts Menu in the Menu Bar (I can’t find mine), and after running this, any script you put in your user’s library/Scripts folder will appear there. By simply choosing a script, it will run for you. Probably the best way to go.
-- From script by Kai Edwards
tell (current date) to tell 100000000 + day * 1000000 + (its month) * 10000 + year as string ¬
to set D to (text 4 thru 5 & "/" & text 2 thru 3 & "/" & text -2 thru -1)
set the clipboard to D
If you want the whole year (2007) then change text -2 thru -1 to text -4 thru -1 in the second line at the end.
Thank you I have used a variety of these posts in my mail application.
Could anyone help me modify it to my standard font: helvitica 18.
I know it is simple but then so am I.