Previous 1 2 3 Next 68 Replies Latest reply: Jul 30, 2013 2:30 AM by Nick Williams1
nohairdave Level 1 (0 points)

Ok, so I tried to run some applescripts from mail to do "clever" stuff based on rules.  Nothing.  No sign of life.  So, I tried a "Hello world" script, nothing happened either.


Looking at the console, I see the following reported by Mail:


07/08/2012 18:21:52.789 Mail[627]: Failed execution of AppleScript: /Users/.../Library/Application Scripts/

Error Domain=NSCocoaErrorDomain Code=257 "The file “test.scpt” couldn’t be opened because you don’t have permission to view it." UserInfo=... {NSURL=file://localhost/Users/.../Library/Application%20Scripts/ test.scpt, NSLocalizedFailureReason=Script file is not in the application scripts folder.}


The script file is in ~Library/Application Scripts/

(which is where mail under Mountain Lion defaults me to save the applescript file)


Anyone else seeing this?  Or better still, how to solve it?

OS X Mountain Lion
  • baltwo Level 9 (62,215 points)

    Open the script with the AppleScript Editor, save it to the Desktop, quit ASE, and try running it from the Desktop. it that works, do the same for any other malfunctioning scripts. All the ones that ran in Lion run in ML; although I don't use an Mail ones.

  • Frank Caggiano Level 7 (25,715 points)

    Just tried copying the script Sample Rule Action Script.scpt which is an Apple supplied script to my ~/Library/Application Scripts/ and when the rule I created that had this script as its action fired the script ran OK.


    I would recommend you do the same and see if you can get this script to run. If this script runs there could be a problem with your scripts. If even this script fails then you might have a permissions issue with your Library folder.


    post back, regards


    Message was edited by: Frank Caggiano - I'm running ML BTW.

  • nohairdave Level 1 (0 points)

    I dont think its just related to mail rule scripts - tried a few and am getting mixed results.


    I tried running the script from the desktop - just keep popping up the editor.  No matter how I try to run it.


    I've also noticed that I cant record any actions, either.  No "interesting" console messages either.


    Trying to run the demo Sample Rule Action Script from its default location, also throws the following console messages:


    08/08/2012 12:43:27.393 AppleScript Runner[6101]: CPSGetFrontProcess(): This call is deprecated and should not be called anymore.

    08/08/2012 12:43:28.168[349]: ([0x0-0x4ff4ff][6094]) Exited: Killed: 9

    08/08/2012 12:43:28.000 kernel[0]: memorystatus_thread: idle exiting pid 6094 [DictationIM]


    I'm stumped. 

  • nohairdave Level 1 (0 points)

    Frank, thanks for your reply.


    Yep, tried all that - even did a desperate display dialog "Hello" as a test - this worked outside of mail, but not under the mail library.  Thats the most "success" I've had.


    Definately thinking permissions or other ML side-effect, but cant be sure.


    Do know how I can check the permissions on the library / script folder / script itself?  I've already tried doing a repair permissions via disk utility / onyx as a precaution

  • Frank Caggiano Level 7 (25,715 points)

    Well the usual next step in a situation like this would be to create a new user account, log in as that user and try the procedure out. If it works then you know the problem is in your user environment, if it fails then you're looking at a system wide problem.  Doesn't fix it but narrows down where  to look.


    In this case the new user step will be a bit of a pain because you'll need to setup a mail account of the test user. Even so I'd recommend doing this as it will  give you a more specific troubleshooting path to follow.


    It would seem that if you can copy the script (either the one you create of the Apple supplied default) to the ~/Library/Application Scripts/ folder the basic permissions would be OK.  The folder and script shouul be read/writable by you. Not sure just what would be the next step which is why I think it is important to see if a new user would be able to have the mail rule fire the script.


    good luck


  • nohairdave Level 1 (0 points)



    Tried that today - no luck.


    Applescript editor can't record any actions.  Any "complex" script doesnt seem to work directly in applescript, mail rules dont appear to trigger


    I guess there must be something fundamentally wrong with my installation - as looking around the forums there's a lot of other users saying scripting / recording is working for them.  That said, I have a second machine (an upgraded iMac) with the same problem.


    When I get a chance, I'll try a fresh install, or try this on a non-ML mac.  Perhaps that will solve the problem or give me a clue to the problem.

  • jbauer Level 1 (0 points)

    I'm having the same kind of issue.  I'm also running ML, but not sure that's the root of the issue.


    This simple script WON'T WORK!


    set pathToSickBeard to "/Applications/Sick-Beard"

    do shell script "python " & pathToSickBeard & "/ > /dev/null 2>&1 &"


    I can enter the command in terminal, and it works PERFECTLY, but in AppleScript or running the app just fails.


    I've been banging my head against the wall trying to figure out why for about a week.




    - Jon

  • cdnSpinalTap Level 1 (0 points)

    Anybody having any luck, I am having the exact same problem.



  • PeterVandewalle Level 1 (0 points)

    I think it's linked to the safety restrictions Apple has built into ML.

    I have tried a script that activates a nn-running software (i.e. Textedit).


    activate application "TextEdit"


    It launches TextEdit but doesn't make it active.

    So I can't work the TextEdit file...

    Any ideas on how to force TextEdit to come forward?

  • Pierre L. Level 5 (4,235 points)

    Any ideas on how to force TextEdit to come forward?


    tell application "TextEdit"



        make new document at front

    end tell




    tell application "TextEdit"

        make new document at front


    end tell

    and so on… 


    Message was edited by: Pierre L.

  • PeterVandewalle Level 1 (0 points)

    I got it to there also. But the software I'm using doesn't understand the "launch" command...


    Any solutions?

  • Tony T1 Level 6 (8,975 points)

    I'm also having this problem that started with ML.

    In Mail, the Rule will run with Message->Apply Rules, however, it will not work on incoming messages.

    The Console Error is:


    08/29/12 8:26:30.676 PM Mail[2958]: Failed execution of AppleScript: /Users/Tony/Library/Application Scripts/

    Error Domain=NSPOSIXErrorDomain Code=2 "The operation couldn’t be completed. /usr/bin/osascript: couldn't set default target: no eligible process with specified descriptor

    " UserInfo=0x7ffd1d8e0330 {NSURL=file://localhost/Users/Tony/Library/Application%20Scripts/ /JunkFilter.scpt, NSLocalizedFailureReason=/usr/bin/osascript: couldn't set default target: no eligible process with specified descriptor


  • Jacknumpty Level 1 (0 points)

    Hi after upgrading to Mountain Lion the applescript that I use to reply to certain emails has stoped working on incoming emails. I have the script in the "new" correct folder. The funny thing is that the script works when you "apply rules" from the messages dropdown menu.

  • baltwo Level 9 (62,215 points)

    File a bug report with Apple for lost functionality.

Previous 1 2 3 Next