Make Calendar open to show "today"

Discussion in 'OS X Yosemite (10.10)' started by adrianlondon, Oct 28, 2014.

  1. adrianlondon macrumors 6502a

    adrianlondon

    Joined:
    Nov 28, 2013
    Location:
    Switzerland
    #1
    I'm not 100% sure now, as I've had Yosemite for quite a while (I started with the PB) but I think on Mavericks the calendar always opened to show the current week (I use the week view).

    Now, it opens on whatever week I happened to last be looking at. I don't like this and want it to always open on the current week (equivalent to pressing "today"). Is this possible?
     
  2. NoBoMac macrumors 68000

    Joined:
    Jul 1, 2014
    #2
    Sorry, don't know of a switch.

    Seems to be hard-wired in Calendar in that when Calendar exits, it writes out to the defaults system an attribute "CalFirstVisibleDate" with a date corresponding to your last view. Same thing happens with month view (eg. attribute is set to ""2014-10-19 06:30:00 +0000" for current month, when I view Nov and exit, the value is now "2014-11-16 06:30:00 +0000").

    So, left as an exercise re: Applescript, shell script/App Factory, etc., the following works from the shell. For example, to get Calendar to open on today:

    So, obviously, date value would have to be generate dynamically and substituted for today.
     
  3. adrianlondon thread starter macrumors 6502a

    adrianlondon

    Joined:
    Nov 28, 2013
    Location:
    Switzerland
    #3
    Thanks!

    I've never written an Applescript before, but I found just running the following does what I need:

    defaults delete com.apple.iCal CalFirstVisibleDate

    So I simply need to call this line before opening the calendar. Perfect. Thanks again.
     

Share This Page