+ return noErr;
+}
+
+
+static OSErr
+handle_print_documents (const AppleEvent *inAppleEvent,
+ AppleEvent *outAppleEvent,
+ long inHandlerRefcon)
+{
+ return noErr;
+}
+
+
+static OSErr
+handle_open_documents (const AppleEvent *inAppleEvent,
+ AppleEvent *outAppleEvent,
+ long inHandlerRefcon)
+{
+ AEDescList docs;
+
+ if (AEGetParamDesc(inAppleEvent, keyDirectObject, typeAEList, &docs) == noErr) {
+ long n = 0;
+ AECountItems(&docs, &n);
+ UInt8 strBuffer[PATH_MAX+1];
+
+ /* ardour only opens 1 session at a time */
+
+ FSRef ref;
+
+ if (AEGetNthPtr(&docs, 1, typeFSRef, 0, 0, &ref, sizeof(ref), 0) == noErr) {
+ if (FSRefMakePath(&ref, strBuffer, sizeof(strBuffer)) == noErr) {
+ Glib::ustring utf8_path ((const char*) strBuffer);
+ ARDOUR_UI::instance()->idle_load (utf8_path);
+ }
+ }
+ }
+