10 Replies Latest reply: Apr 6, 2014 7:03 PM by tabbycat14
alexhax Level 1 Level 1 (0 points)

Hello there,

 

Numbers used to have a item on Inset menu that would inset today's date in a cell in a couple clicks.

 

Does anybody knows the new pathway to get that done?

 

 

Alex


iMac, OS X Mavericks (10.9)
  • Jerrold Green1 Level 7 Level 7 (29,935 points)

    Alex,

     

    Type: =TODAY()

     

    Reselect the cell and type:

     

    Command-C, Shift-Command-V, Return

     

     

    Jerry

  • SGIII Level 5 Level 5 (5,835 points)

    Hi Alex,

     

    If you often enter dates here is a way that can save you some time.

     

    (This is a one-time setup. Using it thereafter is just a menu pick or keyboard shortcut.)

     

    Open Automator (in your applications folder) and choose Service as document type;

     

    service.png

     

     

    Drag Run AppleScript action from the left over into the right pane:

     

    run-applescript.png

     

     

    Copy this script and paste it into the right pane (replacing what's there):

     

    on run

              set date_ to ((current date) as string)

      set the clipboard to the date_

    end run

     

     

    After clicking the hammer, the right pane should now look like this:

     

    script.png

     

    Save the Automator Service as "Get Date" or whatever you want to call it.

     

    You only need to do these setup steps steps ONCE.

     

    Now, whenever you need to input the date, just choose Get Date in the Numbers Services menu.

     

    services-menu.png

     

    And paste into the cell where you need it with command-v.

     

    If you don't like the services menu you can also assign Get Date to a keyboard shortcut, so you would type your keyboard shortcut followed by command-v.

     

    SG

  • thyondesign Level 1 Level 1 (5 points)

    Well I wasn't using it in a cell but in a text box. Why would they remove such a feature that is still present in the new Pages? Totally weird.

     

    The best thing about it being a field was, that it operated in two ways: quickly update the inserted date field manually (quick double click), or fully automated on load. This *****!

  • SGIII Level 5 Level 5 (5,835 points)

    No idea why it didn't make the cut in Numbers 3.0. Maybe they'll bring it back. Meanwhile, there is a pretty painless workaround.

     

    You can paste in a cell or text box, wherever. All this does is place the current date & time in the clipboard, as if you had typed it.

     

    Forgot to mention one part of the setup (that Alex discovered). You need to select no input at the top of the pane after you've dragged Run AppleScript over to the right.

     

    Screen Shot 2013-10-26 at 10.01.25 AM.png

     

    SG

  • SGIII Level 5 Level 5 (5,835 points)

    Cross-posted from a similar thread in case anyone is interested in assigning a keyboard shortcut:

     

    In case you want to add a keyboard shortcut you would go to System Preferences>Keyboard>Shortcuts, scroll down to find the Automator Service you just created ('Get Date' in my case, 'Today; in alexhax's), check the box and assign a keystroke combination that isn't already used.

     

    Screen Shot 2013-10-26 at 10.56.58 AM.png

     

    SG

  • tabbycat14 Level 1 Level 1 (0 points)

    Through the scipt; can you customize the way the date appears in the cell?

  • SGIII Level 5 Level 5 (5,835 points)

    Normally I customize the appearance of the date in the cell within Numbers:

     

    Screen Shot 2014-04-06 at 8.16.37 PM.png

     

    But, if that is not convenient, there are ways to have AppleScript format the string it puts on the clipboard.  Do you you have a particular format in mind?  If you do, post it, and I think I can demonstrate how to customize the script to produce what you want.

     

    SG

  • tabbycat14 Level 1 Level 1 (0 points)

    Hi,

    I was looking to put e.g.  "Apr 4 Fri" with the Services - Get Date

  • SGIII Level 5 Level 5 (5,835 points)

    It is not hard to have AppleScript produce the string in the format of "Apr 4 Fri". For example, these two lines in the script:

     

      set date_ to ((current date) as string)

      set the clipboard to the date_

     

    could be replaced with these:

     

      set {year:y, month:m, day:d, weekday:wd} to (current date)

      set customDate to text 1 thru 3 of (m as text) & " " & d & " " & text 1 thru 3 of (wd as text)

      set the clipboard to customDate

     

     

    But I don't think Numbers will recognize your chosen format as a date.  So you wouldn't be able to base any calculations on the target cell in which you place the date. Is that what you want?

     

    SG

  • tabbycat14 Level 1 Level 1 (0 points)

    SG,

    Thanks for the input, but I'm going to stay with the original.

    TC