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

  • Home
  • SEARCH
  • 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 8826469
In Process

The Archive Base Latest Questions

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

I would like to launch applications (or send to them using AppleEvents) using NSPasteboard

  • 0

I would like to launch applications (or send to them using AppleEvents) using NSPasteboard data just like is done in the Finder when you drag and drop a file, text, image on an application (or in the Dock) and it launches or invokes the data in the app.

Launch services functions like LSOpenFromURLSpec work only for files and I see there is an option to arbitrary parameters of AppleEvents but I could not figure out how to make this work.

Another question would be is the sandboxable but I’m not sure it’s possible at all yet.

Thank you.

  • 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:08:46+00:00Added an answer on June 14, 2026 at 7:08 am

    When you’re the receiver, what happens depends on what the user is dropping:

    • One or more files

      The application is sent one or more open document Apple Events. NSApplication tries to send at least one (should really be only one, but this has been broken for a few versions) message to its app delegate before trying the document controller.

    • One or more URLs (not of the file: scheme)

      The application is sent one or more get-URL events. You’d need to implement an Apple Event handler for this. Conveniently, this is the example the Apple Event handling documentation uses.

    • Any other data

      You need to implement a service. Which service will be used for Dock drops is auto-detected based on types, and I don’t know how it picks among multiple matches; there’s no way to specify only certain services as being available to the Dock. You guessed correctly with regard to NSPasteboard: You implement services using pasteboards for I/O.


    When you’re the sender:

    • Sending files

      The easiest way is to use Launch Services. This will send the appropriate Apple Events on your behalf.

    • Sending URLs

      Again, Launch Services will send the requisite Apple Events for you. Indeed, in modern code, you’ll probably use the same LSOpen API(s) for both file and non-file URLs.

    • Sending any other data

      As the receiving application must implement a service, so must you perform a service.

      The hard part is discovery: you need to know which service you want to perform, and it needs to be available. I assume that you know which application you’ll be sending to (simulating a drop onto), which is a leg up on most people who’ll intend to send to a service. I’m pretty sure you’ll just have to look at the target application’s Info.plist and find which service best matches the types you have yourself.

      One potential wrinkle is that you can’t specify an application bundle. You’ll have to hope that the targeted application’s services are enabled to show up in the Services menu, and you’ll have to figure out the correct menu item name yourself. (Experiment with what’s showing up in your own Services menu to try to derive the correspondence.) Even if you come up with the correct service item name and the service is enabled, there’s no guarantee that the service will be performed by the application in the bundle you were looking at—it may be a different version or even (possibly, depending on how the names are constructed) a different app that has a service with the same name.

      You may want to file a Radar about this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using uWSGI to deploy several python applications. We would like to use
I would like to launch a Scala Swing application from the command line, then
I have a Cocoa application (.app) and I would like to launch it from
I've got a dual processor machine and I would like to launch an executable
I have implemented a ListActivity , and would like to launch a different intent
http://railskits.com/map/ Would you like to launch your own google map mashup? Need a way
My first application will just be a kind of launcher that I would like
I would like to provide a large number of inhouse .net applications with a
Background The company I'm working in would like to launch an iOS app to
I would like to be able to build test applications (e.g. the nightly Minefield/Firefox)

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.