Currently, I am studying the JavaScript for automation session at WWDC. Here is an example taken from slide 99 that I am working on. On a fresh installation of Yosemite, I encountered an error on line 3.
Safari = Application('Safari')
doc = Safari.document[0]
url = doc.url() // -> this is where the issue occurs
doc.url = 'http://apple.com'