Subject: Re: [Butler Talk] Auto-insert Today's Date

From: Bas Ovink <[email-masked]>
Date: Thu, 22 Feb 2018 02:59:42 -0800 (PST)

Solution in Applescript with more control over the formatting:

-- Insert Date and Time into your documents
-- Based on @2012 David Rodrigues

date_format((current date) as string)

to date_format(old_date) -- Old_date is text, not a date.
set {year:y, month:m, day:d} to date old_date
tell (y * 10000 + m * 100 + d) as string to text 1 thru 4 & text 5 thru 6 & 
text 7 thru 8
end date_format

---

From: Rob Griffiths <[email-masked]>
Date: Thu, 3 Jul 2014 08:13:41 -0400

On Jul 2, 2014, at 2:52 PM, Troy Harris <[email-masked]> wrote:

> I'd like to activate Butler, type "dt", hit return, and have today's date appear in a preferred format (in my case m/d/yy). Is that possible with Butler? If not, does anyone know how to accomplish that?
> Thanks!

While you could do it with Butler, it's not really something it's designed to do. Instead, this is a task that's perfectly designed for TextExpander or TypeIt4Me or similar shortcut expansion utilities. They have features that do just what you want, in many possible formats. Here's how it'd look in TextExpander:

I type -dt, and it expands into the specified date format. I'd recommend looking into one of these utilities; they're well worth the cost. (Mild disclaimer: TextExpander was originally written by Many Tricks, but we sold it to Smile many years ago.)

Beyond date insertion, these apps save a ton of time with other often-typed snippets. But if you really want to use Butler for this, you could do it in a number of ways. Here's one...

1) Create a new Smart Items > AppleScript > AppleScript entry. Create a name for it in the top input box, i.e Paste Date or similar. (Make sure you Tab out of the name field to get it to stick.)

2) Paste this text into the Source Code tab:

do shell script "date '+%m/%d/%Y'"

3) On the Options tab, check the "Paste result when executed" box.

4) On the Triggers tab, put 'dt' (no quotes) into the Abbreviation box.

That should do it -- you should be able to press Ctrl-Space, type dt, and hit Return to have the date inserted into whatever app is frontmost when you execute the command. Note that with TextExpander et al, you don't need to press Return to insert your expansion, and they don't have to be activated first, so you'll save keystrokes using these apps.

But yes, it's possible in Butler :).

regards,
-rob.

---

From: Troy Harris <[email-masked]>
Date: Wed, 2 Jul 2014 11:52:22 -0700 (PDT)

I'd like to activate Butler, type "dt", hit return, and have today's date 
appear in a preferred format (in my case m/d/yy). Is that possible with 
Butler? If not, does anyone know how to accomplish that?
Thanks!

Running OSX10.9