0

I am developing a Quick Look plugin on Mac OSX 10.10. To provide previews for our custom file formats, I need to call our mac application from the Quick Look plugin for which I have used the NSAppleScript class:

NSAppleScript *script = [[NSAppleScript alloc] initWithSource:
                                 @"\
                                 tell application \"MyApp\"\n\
                                 end tell\n\"];

The problem is that I always get a "Application is not running" message in the output window whether MyApp is running or not. I am running the QLMANAGE to debug this plugin. I even tried setting the full path of MyApp as:

tell application "\Applications\MyApp.app"

but it did not help. Does NSAppleScript object has permission to launch an application? Is this a permission issue with Quick Look plugin that a plugin cannot launch or connect to an application? Or some restrictions for qlmanage tool?

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
A9S6
  • 6,575
  • 10
  • 50
  • 82
  • What is the relationship between your application running an NSAppleScript object and MyApp.app? Is the former sandboxed? – El Tomato May 20 '15 at 10:51
  • @ElTomato: I am new to Mac OSX programming. How do I find out whether my application is sandboxed? I found an articles that talks about a similar problem though: http://www.objc.io/issue-14/sandbox-scripting.html – A9S6 May 20 '15 at 13:50
  • In your project, select the project-icon and under TARGETS select your target. On the right side you have "Capabilities" where you can switch sandbox etc on / off. And in "Build Settings" there is also a "Code Signing" setting. –  May 20 '15 at 18:11

0 Answers0