Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Why Does AppleScript Fail With Google Earth?

This simple script:


tell application "Google Earth"

GetCurrentVersion

end tell


fails with the following error:


error "Google Earth got an error: Can’t continue GetCurrentVersion." number -1708


and with the following Console message:


3/2/13 5:24:42.505 PM Google Earth[53575]: +[NSDictionary scriptingRecordWithDescriptor:]: unrecognized selector sent to class 0xacdb248c


Anyone know why?


The GE AppleScript dictionary has the following entry:


GetCurrentVersionv : Get the current version of the Google Earth client

GetCurrentVersion record : record of major, minor and build numbers

→ list of integer : version fields


AppleScript and Google Earth work fine for other users on this machine. It only fails on my account.


I have tried deleting all vestiges of GE from the machine and reinstalling, but this hasn't worked.


Any other ideas?

Posted on Mar 2, 2013 2:52 AM

Reply
36 replies

Mar 3, 2013 2:04 AM in response to HD

Interesting.


I got a quick but rather different reply from Thorsten: "that is really curious. Because it works here. I will recheck."


I've done a lot of searching on this issue and haven't run across anyone with the same problem or any mention of a similar problem


I agree with Thorsten, it is curious.


Anyway, thanks for helping out and thanks for the cake offer. Next time I'm in Bath....


(I live in northeast Thailand!)

Mar 3, 2013 2:28 AM in response to Buadhai

It does looks as though AppleScripting is a bit broken in Google Earth.


tell application "Google Earth" to display dialog (latitude of (GetViewInfo))


works once, then repeatedly returns an error (can't get latitude of missing value) until I restart Google Earth. Then it works once, then fails again.


Looks like I was wrong about Graphic Converter being the culprit.

Mar 3, 2013 2:39 AM in response to HD

Same here.


I don't understand why there are not more reports of this bug. According to Thorsten, he's never seen this error in GC. And, it seems that I'm the only one who has reported it to him (and now you).


If you go to the Google Earth product forum: https://productforums.google.com/forum/#!forum/earth


and do a search on AppleScript you only get back a few results, two of which are mine.


Has no one else noticed this? Do people just give up?


Very odd.

Mar 3, 2013 9:53 PM in response to Buadhai

Buadhai wrote:



AppleScript and Google Earth work fine for other users on this machine. It only fails on my account.



I just downloaded Google Earth to test it on my machine. No problems here.


I think the clue to your problem is in the quote above. Something else is running interference.


Usual first step to try to isolate the problem is to remove everything from Login Items in  > System Prefs > Users & Groups, then restart your mac and test.


If that doesn't help, try removing the content of your user ~/Library/Internet Plug-ins to a temp folder on your desktop, restart again and test.


Still no joy, move everything out of ~/Library/Caches to another temp folder on your desktop, restart and test.

Mar 3, 2013 10:24 PM in response to softwater

Look at the last two posts on the first page of this thread.


Here's what I did:


  • Create a brand new account on my machine
  • Open Google Earth
  • Confirm with AppleScript Editor that AS works with Google Earth
  • Open Graphic Converter and geotag a photo based on the current GE position
  • This fails with no error message
  • Confirm with AppleScript Editor that AS no longer works with Google Earth
  • Quit Graphic Converter and delete its preferences and caches
  • Confirm with AppleScript Editor that AS again works with Google Earth


Since the problem is reproducible with a brand new pristine user account, it's not a login item, it's not an Internet plug-in and it's not a user-level cache; except maybe the Graphic Converter cache.


It appears to be some strange interaction between Graphic Converter and Google Earth.


However, the author of Graphic Converter says that I am the only user who has reported this problem.


Then again, have you tried HDs experiment?


It does looks as though AppleScripting is a bit broken in Google Earth.


tell application "Google Earth" to display dialog (latitude of (GetViewInfo))


works once, then repeatedly returns an error (can't get latitude of missing value) until I restart Google Earth. Then it works once, then fails again.


Looks like I was wrong about Graphic Converter being the culprit.

Mar 4, 2013 12:23 AM in response to Buadhai

Then again, have you tried HDs experiment?


It does looks as though AppleScripting is a bit broken in Google Earth.


tell application "Google Earth" to display dialog (latitude of (GetViewInfo))


works once, then repeatedly returns an error (can't get latitude of missing value) until I restart Google Earth. Then it works once, then fails again.


Looks like I was wrong about Graphic Converter being the culprit.


I only get that error if no location has been set (i.e., you're looking at the whole earth rather than a particular latitude). Note that causing Google Earth to run by executing the command returns the value '0' the first time, and 'missing value' the second time; i.e, there's no value set the latitude of view info.


Once I actually move to a location (type anything in the search bar), it works correctly every time, repeatedly on the same location or for every change of location.

Mar 4, 2013 12:40 AM in response to softwater

If I run HD's script:


tell application "Google Earth"


display dialog (latitude of (GetViewInfo))

end tell


I always get the following error:


error "Can’t get latitude of missing value." number -1728 from «class Elat» of missing value


Even if I:


  • Quit Google Earth
  • Run Google Earth
  • Search in Google Earth for a specific address
  • Run the script


(Note that I am not an AppleScript author. All I really want to do is get Graphic Converter to play nice with Google Earth for the purpose of geotagging photos.)

Mar 4, 2013 4:48 AM in response to Buadhai

You still seem to be overlooking the most pertinent fact, if you don't mind my saying so - the problem appears to be peculiar to you (and perhaps HD...), which suggests its something on your system.


In your first post you said it didn't affect other users on the same computer, then at the end of page 1 you said it occurs in a test account. I'm not sure how to resolve that contradiction, but be aware things you do in your user account can affect system settings, which can in turn have an impact even on new user accounts.


I think the next thing I'd try in your shoes is starting up in safe mode and seeing whether the problem still occurs there.


You might also have a scroll through what's in these folders that looks unfamiliar (note: none of these refer to your user account) and which does NOT begin with the prefix com.apple.


[hard disk]/Library/Caches

[hard disk]/Library/LaunchAgents

[hard disk]/Library/LaunchDaemons

[hard disk]/Library/StartupItems


[hard disk]/System/Library/Internet Plug-ins

Why Does AppleScript Fail With Google Earth?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.