I am following the WWDC talk Javascript for automation. Following is an example from slide 99. I am getting an error on line 3 on new install of yosemite.
Safari = Application('Safari')
doc = Safari.document[0]
url = doc.url() // -> here
doc.url = 'http://apple.com'