Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In general, these are handled through <em>Apple Events</em>. Specifically, your application will receive an <em>open document</em> event. How you would handle it depends on what type of application you are writing.</p> <p>If you're writing a document-based app, this is easy: the document controller receives an <code>openDocumentWithContentsOfURL:display:error:</code> message (or <code>openDocumentWithContentsOfFile:display:</code> for pre-Tiger systems), and will <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSDocumentController_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDocumentController/openDocumentWithContentsOfURL:display:error:" rel="nofollow noreferrer">handle this accordingly</a>.</p> <p>For Cocoa apps that aren't document based, the application delegate will be sent an <code>application:openFiles:</code> message. If the delegate doesn't respond to that, it will try sending other messages until the delegate responds to one (<code>openTempFile:</code>, <code>openFiles:</code>, and <code>openFile:</code>, in that order).</p> <p><a href="http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_handle_AEs/SAppsHandleAEs.html#//apple_ref/doc/uid/20001239-1119823" rel="nofollow noreferrer">Here's the documentation</a> for handling Open Apple Events in Cocoa.</p> <p>For Carbon apps, I can't really remember the details (been a while since I've written Carbon code), but if I recall correctly, you would install an Apple Event handler for <code>kAEOpenDocuments</code> events with <code>AEInstallEventHandler()</code>. See <a href="http://developer.apple.com/documentation/Carbon/Reference/Apple_Event_Manager/Reference/reference.html#//apple_ref/c/func/AEInstallEventHandler" rel="nofollow noreferrer">the documentation</a> for more details.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload