Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:33:36+00:00 2026-06-14T07:33:36+00:00

I am trying to execute an Automator workflow from a sandboxed AppKit app. Minimal

  • 0

I am trying to execute an Automator workflow from a sandboxed AppKit app.

Minimal example + github repo :

   NSOpenPanel * panel = [NSOpenPanel openPanel];
   [panel setAllowsMultipleSelection:NO];
   [panel setCanChooseFiles:YES];
   [panel setCanChooseDirectories:NO];
   [panel setAllowedFileTypes:[NSArray arrayWithObject: @"com.apple.automator-workflow"]];
    NSInteger result = [panel runModal];

    if (result == NSFileHandlingPanelOKButton) {
      NSURL * workflow = [[panel URLs]objectAtIndex:0];
      NSLog(@"selected url %@", workflow);
      NSError * error = nil;
      [AMWorkflow runWorkflowAtURL:workflow withInput:[NSArray arrayWithObject:workflow] error:&error];
      if(error) {
          NSLog(@"Error while executing workflow %@", [error localizedDescription]);
      }        
    }

From my current understanding of the AMWorkflow API I assume it uses Mach IPC to execute the workflow in a separate Automator Runner process.

This is why I added the following entitlement to my app:

   <key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
   <array>
     <string>com.apple.AutomatorRunner</string>
     <string>com.apple.Automator</string>
   </array>

But apparently Automator Runner tries to connect back to the calling app which fails with the following error msg:

Automator Runner(2717) deny mach-lookup  /Users/pbrc/Library/Developer/Xcode/DerivedData/AMWorkflowCaller-arjgkslqihljquelyvybmpsnljrn/Build/Products/Debug/AMWorkf

0   libsystem_kernel.dylib          0x00007fff96ce9686 mach_msg_trap + 10
1   liblaunch.dylib                 0x00007fff8db637c4
2   liblaunch.dylib                 0x00007fff8db624d9 bootstrap_look_up3 + 69
3   liblaunch.dylib                 0x00007fff8db62609 bootstrap_look_up2 + 40
4   Foundation                      0x00007fff8f4acffe -[NSMachBootstrapServer portForName:options:] + 102
5   Foundation                      0x00007fff8f4b84cb +[NSConnection connectionWithRegisteredName:host:usingNameServer:] + 30
6   Automator Runner                0x0000000100001a51 -[AMRunnerDelegate processArguments] + 487

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:33:37+00:00Added an answer on June 14, 2026 at 7:33 am

    The simple answer is that the AMWorkflow API does not work in sandboxed applications. There is an alternative API which has been introduced recently, which works with sandboxed applications:

    NSUserAutomatorTask executeWithInput:completionHandler:
    

    Using this API you can execute automator scripts that are located in the script folder of your application:

    /Users/USERNAME/Library/Application Scripts/BUNDLENAME.APPNAME

    There is one significant caveat: Despite the method’s “input” argument no input will be passed through to the automator workflow on versions of Mac OS prior to 10.8.3 12D75 (this is/was a bug):

    NSUserAutomatorTask * task = [[NSUserAutomatorTask alloc] initWithURL:workflow error:&error];
    if(error) {
        NSLog(@"Error while creating script task %@", [error localizedDescription]);
    }
    
    [task executeWithInput: @"this will never reach your workflow" completionHandler:^(id result, NSError *error){
        if(error)
            NSLog(@"Error while executing workflow %@", [error localizedDescription]);
    }];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I`m trying to execute linux commant 'cat' from java code, but it does not
I'm trying to execute a PowerShell script from a c# application. The script has
Trying to execute powershell script in my C# code. Using .NET Framework v. 4.0.30319
Im trying to execute a .bat file remotely in a powershell script. The code
While trying to execute the following lines only the last two statements are displayed(Here
I`m trying to execute a shell command with arguments in C# , and The
I'm trying to execute command prompt commands and read the output in C#. This
I am trying to execute the following query in oracle but not able to
When I'm trying to execute a functional unittest of a module within my Yii
I'm trying to execute the following code, but I'm getting SyntaxError: invalid syntax at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.