baltwo

Q: Yosemite AppleScript stopped working, error -1708

Just installed Yosemite GM (14A389) and tried to run some of my script apps, which work w/o issues in Mavericks and earlier. I’m getting error -1708 for most of them. The ones that use “do shell script” or “display dialog,” for example, are erroring. E.g., this one is from a script app that toggles invisibles on and off, but I can’t even ascertain the current value from the Finder plist using this command:

 

do shell script "defaults read com.apple.finder AppleShowAllFiles"

 

yields this error message:

 

"defaults read com.apple.finder AppleShowAllFiles" doesn’t understand the “do shell script” message." number -1708 from "defaults read com.apple.finder AppleShowAllFiles"

 

A google search for error 1708 yields this https://discussions.apple.com/thread/5132915?tstart=0, and suggests reinstalling the COMBO updater as a fix. There’s none for this GM version.

 

I used Pacifist to reinstall the Script Editor app, restarted, but that didn’t fix things. Any gurus out there who can explain what to do, besides reinstalling the entire upgrade and wasting another hour waiting for that to finish?

iMac (27-inch Mid 2011), OS X Yosemite (10.10), Mavs, ML & SL, G4 450 10.5 & 9.2.2

Posted on Oct 21, 2014 3:09 PM

Close

Q: Yosemite AppleScript stopped working, error -1708

  • All replies
  • Helpful answers

  • by baltwo,

    baltwo baltwo Oct 23, 2014 5:11 PM in response to baltwo
    Level 9 (62,256 points)
    Oct 23, 2014 5:11 PM in response to baltwo

    No replies, so I guess I'll reinstall over the weekend. Buggers.

  • by VikingOSX,Helpful

    VikingOSX VikingOSX Oct 24, 2014 7:21 AM in response to baltwo
    Level 7 (20,591 points)
    Mac OS X
    Oct 24, 2014 7:21 AM in response to baltwo

    The original toggle hide/unhide AppleScript that you posted way back when, still works unchanged in the released Yosemite (14A389). You may have to recompile the script from source on Yosemite.

     

    -- Submitted by Baltwo on Apple Support Community

     

    try

      do shell script "defaults read com.apple.finder AppleShowAllFiles"

    on error

      do shell script "defaults write com.apple.finder AppleShowAllFiles 0"

    end try

     

    if (do shell script "defaults read com.apple.finder AppleShowAllFiles") is equal to "0" then

      do shell script "defaults write com.apple.finder AppleShowAllFiles 1"

    else

      do shell script "defaults write com.apple.finder AppleShowAllFiles 0"

    end if

     

    do shell script "killall Finder"

  • by Frank Caggiano,Helpful

    Frank Caggiano Frank Caggiano Oct 24, 2014 8:12 AM in response to baltwo
    Level 7 (25,782 points)
    Oct 24, 2014 8:12 AM in response to baltwo

    Ditto. Works for me here on the released version of Yosemite.

  • by baltwo,

    baltwo baltwo Oct 24, 2014 12:48 PM in response to baltwo
    Level 9 (62,256 points)
    Oct 24, 2014 12:48 PM in response to baltwo

    Thanks both. IIRC, it did work under pre-GM versions, that's why I suspect a hosed installation. According to the MacErrors.h file from Mavs (can't find it in Yo, but maybe because of the hosed installation), the error is:


    errAEEventNotHandled (-1708) /*  -->  the AppleEvent was not handled by any handler  */

  • by VikingOSX,

    VikingOSX VikingOSX Oct 24, 2014 5:00 PM in response to baltwo
    Level 7 (20,591 points)
    Mac OS X
    Oct 24, 2014 5:00 PM in response to baltwo

    The MacErrors.h file is located in the 10.10.sdk, and 10.9.sdk at an identical Xcode hierarchy location. Apple really doesn't want us to find it ... Lol. Saved a copy as PDF in ~/Documents for easier access and search. This is Xcode 6.1.

     

    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/MacErrors.h
    
    

     

    In 10.10 Spotlight, you can type in -1708. A list of applications will appear. Select Xcode, and immediately to the right is the MacErrors.h icon. Click this and Xcode will open this header file for you. Sure beats the hierarchy nightmare above.

  • by baltwo,

    baltwo baltwo Oct 24, 2014 5:17 PM in response to VikingOSX
    Level 9 (62,256 points)
    Oct 24, 2014 5:17 PM in response to VikingOSX

    Cool. Haven't loaded or looked into those locations. Spotlight search is woefully broken and I'm in SL at the moment. Thanks I got it by running this in Terminal:

     

    open /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/

  • by VikingOSX,

    VikingOSX VikingOSX Oct 24, 2014 7:14 PM in response to baltwo
    Level 7 (20,591 points)
    Mac OS X
    Oct 24, 2014 7:14 PM in response to baltwo

    You know, I have crashed the damned awful Script Editor in 10.10 about 30 times tonight doing simple AppleScript. That is 29 times more than Mountain Lion and Mavericks combined. Quality control is shot at Apple.

  • by Phil Stokes,

    Phil Stokes Phil Stokes Oct 24, 2014 7:23 PM in response to VikingOSX
    Level 2 (360 points)
    Oct 24, 2014 7:23 PM in response to VikingOSX
    In 10.10 Spotlight, you can type in -1708. A list of applications will appear. Select Xcode, and immediately to the right is the MacErrors.h icon. Click this and Xcode will open this header file for you. Sure beats the hierarchy nightmare above.

     

    Alternatively, you can just type MacErrors into Spotlight and up it comes..

  • by baltwo,

    baltwo baltwo Oct 28, 2014 5:12 PM in response to Phil Stokes
    Level 9 (62,256 points)
    Oct 28, 2014 5:12 PM in response to Phil Stokes

    Phil Stokes wrote:

    Alternatively, you can just type MacErrors into Spotlight and up it comes..

    Didn't work here. Finds those in SL, Mtn Lion, and Mavs, but not in this abortion. Indexing is complete. Maybe I'll reindex, which is really a PITA.

     

    Update: reindexing.

  • by baltwo,

    baltwo baltwo Oct 28, 2014 5:10 PM in response to baltwo
    Level 9 (62,256 points)
    Oct 28, 2014 5:10 PM in response to baltwo

    Reinstallation fixed the problem. Corrupted update the first time around.