Jump to content

AppleScript Error -1708


Recommended Posts

I created an AppleScript to change the font of selected text in a PowerPoint presentation. Works fine when I trigger it directly from Script Debugger, from keyboard Maestro or through a Service.

 

However, I figured I should be able to trigger it directly from an Alfred workflow so created one and inserted my apple script. However, when I try it there, it doesn't work and I find an error in the console window

 

6/17/15 8:40:55.132 AM Alfred 2[447]: [ERROR] AppleScript Error: {
    NSAppleScriptErrorNumber = "-1708";
}
 

 

No idea what that error number means (couldn't find it anywhere) but given that the script works just fine via three other invocation methods, this would seem like an Alfred problem.

 

Note: I did add Alfred to the list of apps that's allowed to control my computer (from the Accessibility part of Security &Privacy preferences)

 

Anyone know what might be going on?

 

I'm running OS X 10.10.3 so not even a beta!

Link to post

AppleScript behaves in different ways depending on how it's called and from where, so yes, sometimes you do have to do that.

 

FWIW, you should probably always use Run Script and /usr/bin/osascript because the other way can block Alfred.

Link to post

Well, I called it three other ways (from three other programs) with no problems. I'd still like to understand what the error meant. I understand it can block Alfred. On the other hand, if you're never supposed to use it directly, why is it possible to do so?

 

______

AppleScript behaves in different ways depending on how it's called and from where

Link to post

A quick Google turns up:

Error Number:      -1708
Error Domain:      Carbon
Error File Name:   MacErrors.h
Error Name:        errAEEventNotHandled
Error Description: the AppleEvent was not handled by any handler

It's impossible to say what that means because you haven't actually posted the code that's causing the error.

I don't know why Alfred has two ways to run AS (you'll have to ask Andrew). If I had to guess, I'd say it's for performance reasons: starting a subprocess (as Run Script actions do) is a relatively expensive operation.

Link to post
  • 1 year later...

Just got this same error message (and applied the same fix, using a Run Script action) working on an AppleScript for Microsoft Word.  Chances are its an artifact of the MS code base being 15+ years old at this point -- supposedly Office 2016 was a complete rewrite in Cocoa but it looks like there's still some Carbon deep down in there.

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...