Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

adrianlondon

macrumors 603
Original poster
Nov 28, 2013
5,682
8,576
Switzerland
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?
 
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:

defaults write com.apple.iCal CalFirstVisibleDate -date "2014-10-28 06:00:00 +0000"
/Applications/Calendar.app/Contents/MacOS/Calendar &

So, obviously, date value would have to be generate dynamically and substituted for today.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.