alexhax

Q: How do I insert today's date in a cell on Numbers 3.0?

Hello there,

 

Numbers used to have a item on Inset menu that would insert 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)

Posted on Oct 26, 2013 3:53 AM

Close

Q: How do I insert today's date in a cell on Numbers 3.0?

  • All replies
  • Helpful answers

Previous Page 2 of 3 last Next
  • by SGIII,

    SGIII SGIII Oct 26, 2013 9:34 AM in response to SGIII
    Level 6 (10,782 points)
    Mac OS X
    Oct 26, 2013 9:34 AM in response to SGIII

    Ok, here's an improved Automator Service that has the same functionality as Insert Date Date & Time in the old Numbers. It incorporates slypix's idea of eliminating need for manual command-v. And it preserves the original cell formatting.

     

    on run

              set date_ to ((current date) as string)

      set the clipboard to the date_

              tell application "Numbers"

         activate

         tell application "System Events"

           keystroke "v" using {shift down, option down, command down}

         end tell

       end tell

    end run

     

     

    In Automator it looks like this (note that it's set to receive no input).

     

    Screen Shot 2013-10-26 at 12.23.44 PM.png

     

    On my machine I have the old Numbers renamed to Number09 so the service doesn't get confused.

     

    Numbers 3.0 doesn't appear in the AppleScript dictionary on my machine. But it will respond to the activate command. And presumably some simple GUI scripting is possible, as with other Mac applications.

     

    SG

  • by slypix,

    slypix slypix Oct 26, 2013 10:32 AM in response to SGIII
    Level 1 (10 points)
    Oct 26, 2013 10:32 AM in response to SGIII

    Thanks for the Update, works perfectly, Numbers.app doesn't show up at all in my applescript dictionary, but as long as I have my shortcut I'm Happy.

    Screen Shot 2013-10-26 at 1.28.12 PM.png

  • by alexhax,

    alexhax alexhax Oct 26, 2013 5:26 PM in response to SGIII
    Level 1 (0 points)
    Oct 26, 2013 5:26 PM in response to SGIII

    That is great,

    I need to change the text style on mine too. But I have one more thing:

     

    I'm actually trying to make a list for date that insert a paticular formatation, where in enters the month, space and the day. Both with two digits so that on January 3rd it would enter 01 03.

    date.png

    I've tryied going to System Preferences > Language&Region > Advanced... > Dates

    but it does not change drop box in the cell Data format.

    box.png

  • by alexhax,

    alexhax alexhax Oct 26, 2013 6:15 PM in response to SGIII
    Level 1 (0 points)
    Oct 26, 2013 6:15 PM in response to SGIII

    Curiously, on the new Numbers for iOS 7 the Today button appears on the keyboard if you select the day or year up there.

    IMG_0499.PNG

  • by alexhax,

    alexhax alexhax Oct 26, 2013 6:25 PM in response to alexhax
    Level 1 (0 points)
    Oct 26, 2013 6:25 PM in response to alexhax

    If you create a new row and hit Today it will enter the current date preserving the style and formatation of the row above.

  • by SGIII,

    SGIII SGIII Oct 26, 2013 6:34 PM in response to alexhax
    Level 6 (10,782 points)
    Mac OS X
    Oct 26, 2013 6:34 PM in response to alexhax

    alexhax wrote:

     

    Curiously, on the new Numbers for iOS 7 the Today button appears on the keyboard if you select the day or year up there.

     

    That's great.  Thanks for pointing that out. You'd think the Today button would be in a more obvious place but it's there!

     

    Like you, on the Mac I'm having no luck changing date formats in Language & Region preferences. So far Numbers 3.0 seems to offer the same choices of date format no matter what I try there.

     

    So you could get AppleScript to give you 10 26 as a string that would display the way you want. But it wouldn't be a true date and time value.

     

    And of course there is no "custom format" any more.

     

    SG

  • by addybails,

    addybails addybails May 29, 2014 1:32 PM in response to SGIII
    Level 1 (0 points)
    May 29, 2014 1:32 PM in response to SGIII

    Hi,

     

    is there a way to use your script to just enter the TIME in 24 hour format, in a cell from a keyboard shortcut?

     

    I'm a complete novice to programming, although I'm slightly ok with simple equasions and stuff in Numbers.

     

    I'm using a spreadsheet in Numbers on MacBookAir.

     

    Please give as many instructions as you can in your reply, if you can do this.

     

    Thanks.

     

    Adam.

  • by Jerrold Green1,

    Jerrold Green1 Jerrold Green1 May 29, 2014 1:34 PM in response to addybails
    Level 7 (30,001 points)
    May 29, 2014 1:34 PM in response to addybails

    Use Format Pane, Cell tab, to set the display format.

     

    Jerry

  • by addybails,

    addybails addybails May 29, 2014 1:45 PM in response to Jerrold Green1
    Level 1 (0 points)
    May 29, 2014 1:45 PM in response to Jerrold Green1

    Jerry,

     

    I was asking SGIII as you instructed me to and was referring to his scripts. Your reply doesn't make any sense. I know how to format the contents if a cell, that's not at all what I'm asking for here.

  • by SGIII,

    SGIII SGIII May 29, 2014 2:22 PM in response to addybails
    Level 6 (10,782 points)
    Mac OS X
    May 29, 2014 2:22 PM in response to addybails

    is there a way to use your script to just enter the TIME in 24 hour format, in a cell from a keyboard shortcut?

     

     

    Yes, the AppleScript can produce time in 24-hour format. However, unless I am mistaken, Numbers always stores a date-time string, not just the time.  To see what I mean, try typing 23:00 in a cell and looking lower left (if you are using Numbers 3) at what's actually in the cell.  What you see there may, depending on your localizaton, be different from mine, but it most likely will include both the time and a date.

     

    Screen Shot 2014-05-29 at 5.18.13 PM.png

     

     

    Will that be a problem?  What more specifically are you hoping to do?

     

    SG

  • by addybails,

    addybails addybails May 29, 2014 2:44 PM in response to SGIII
    Level 1 (0 points)
    May 29, 2014 2:44 PM in response to SGIII

    I'm primarily looking for a way to use a keyboard shortcut to enter the current time only in the currently selected cell. I don't need the date, only the time in 24 hour clock.

     

    We use it to log people in and out of the building. And have to do this up to 160 times in a day.

     

    In windows and excel it's CTRL-;

     

    I appreciate Numbers doesn't have such shortcuts tho.

  • by SGIII,

    SGIII SGIII May 29, 2014 2:49 PM in response to addybails
    Level 6 (10,782 points)
    Mac OS X
    May 29, 2014 2:49 PM in response to addybails

    Ok, I'll look at that this evening. I tried it in Excel and Excel seems to insert just a time (whereas Numbers, I think, always inserts date and time even if you just want the time only.)  But if you don't mind having the date in there along with the time, you can have a keyboard shortcut in Numbers too.

     

    SG

  • by addybails,

    addybails addybails May 29, 2014 3:02 PM in response to SGIII
    Level 1 (0 points)
    May 29, 2014 3:02 PM in response to SGIII

    That's a problem really. The cell is only big enough for the time. And I don't have enough room to expand it.

     

    How do I set a shortcut for the date and time tho? I followed some instructions but it only allows the input if you double click the cell rather than just selecting the cell.

  • by addybails,

    addybails addybails May 29, 2014 3:06 PM in response to addybails
    Level 1 (0 points)
    May 29, 2014 3:06 PM in response to addybails

    I just tried to use the shortcut I made for inserting date and time, and it always inserts the date OK, but the time is always 00:00

     

    I also tried to format the cell for date and time, and right justify it, so it only shows the last part of it, which is the time, but when I double click and use the shortcut, it then overrides the format and expands the text beyond the box, and changes the format of the cell.

     

    So it's not really working at all, as I see it.

     

    Adam.

  • by SGIII,

    SGIII SGIII May 29, 2014 7:42 PM in response to addybails
    Level 6 (10,782 points)
    Mac OS X
    May 29, 2014 7:42 PM in response to addybails

    Hi Adam,

     

    Try this 'Insert time' Automator Service (Dropbox dowload) which includes the script below.

     

    To install doubleclick the .workflow package. You may have to click 'Open anyway' in System Preferences > Security & Privacy.  It will then appear automatically in your Numbers > Services Menu.

     

    Then you can assign a keyboard shortcut here (System Preferences > Keyboard):

     

    Screen Shot 2014-05-29 at 10.28.48 PM.png

     

    Thereafter, whenever you need to insert a time just click a cell in Numbers and hit the keyboard shortcut you assigned. Very similar to Excel.

     

    If you ever want to remove the service just hold down the option key in Finder and Go > Library > Services.

     

    SG

     

     

     

    --inserts time in 24-hr format

    set the clipboard to (do shell script "date +%H:%M")

    tell application "Numbers"

              activate

              tell application "System Events"

                  keystroke "v" using {shift down, option down, command down}

              end tell

    end tell

    --end of script

Previous Page 2 of 3 last Next