Script to change screen resolution in Yosemite

I’m looking for a script that will switch between 2 preset screen resolutions in Yosemite.

There are scripts that do this for previous OS versions http://macscripter.net/viewtopic.php?id=38426
but which no longer work because Yosemite has a different menu structure.

I tried Display Menu, which does exactly what I want, except its Applescript function doesn’t work with Yosemite.

My end objective here is to select 5120x2880 when the screen saver starts up. And then switch back to a lower value when the screen saver quits. G-Force at 5120x2880 is spectacular.