diff --git a/lldb.xcodeproj/project.pbxproj b/lldb.xcodeproj/project.pbxproj
index 8e62d01..d64c6c6 100644
--- a/lldb.xcodeproj/project.pbxproj
+++ b/lldb.xcodeproj/project.pbxproj
@@ -1783,7 +1783,6 @@
 		4C626533130F1B0A00C889F6 /* StreamTee.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamTee.h; path = include/lldb/Core/StreamTee.h; sourceTree = "<group>"; };
 		4C66499F14EEE7F100B0316F /* StreamCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamCallback.h; path = include/lldb/Core/StreamCallback.h; sourceTree = "<group>"; };
 		4C6649A214EEE81000B0316F /* StreamCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamCallback.cpp; path = source/Core/StreamCallback.cpp; sourceTree = "<group>"; };
-		4C74CB6212288704006A8171 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
 		4C7CF7E31295E10E00B4FBB5 /* ThreadPlanCallUserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallUserExpression.h; path = include/lldb/Target/ThreadPlanCallUserExpression.h; sourceTree = "<group>"; };
 		4C7CF7E51295E12B00B4FBB5 /* ThreadPlanCallUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallUserExpression.cpp; path = source/Target/ThreadPlanCallUserExpression.cpp; sourceTree = "<group>"; };
 		4C98D3DA118FB96F00E575D0 /* ClangFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangFunction.cpp; path = source/Expression/ClangFunction.cpp; sourceTree = "<group>"; };
@@ -3833,7 +3832,6 @@
 				26F5C32B10F3DFDD009D5894 /* libtermcap.dylib */,
 				26D55234159A7DB100708D8D /* libxml2.dylib */,
 				966C6B7818E6A56A0093F5EC /* libz.dylib */,
-				4C74CB6212288704006A8171 /* Carbon.framework */,
 				EDB919B414F6F10D008FF64B /* Security.framework */,
 			);
 			name = Libraries;
@@ -5409,8 +5407,6 @@
 					"-framework",
 					Foundation,
 					"-framework",
-					Carbon,
-					"-framework",
 					DebugSymbols,
 					"-framework",
 					Security,
@@ -5470,8 +5466,6 @@
 					"-framework",
 					Foundation,
 					"-framework",
-					Carbon,
-					"-framework",
 					DebugSymbols,
 					"-framework",
 					Security,
@@ -5806,8 +5800,6 @@
 					"-framework",
 					Foundation,
 					"-framework",
-					Carbon,
-					"-framework",
 					DebugSymbols,
 					"-framework",
 					Security,
@@ -6614,8 +6606,6 @@
 					"-framework",
 					Foundation,
 					"-framework",
-					Carbon,
-					"-framework",
 					DebugSymbols,
 					"-framework",
 					Security,
diff --git a/source/Host/macosx/Host.mm b/source/Host/macosx/Host.mm
index 454de85..7c28282 100644
--- a/source/Host/macosx/Host.mm
+++ b/source/Host/macosx/Host.mm
@@ -63,10 +63,6 @@
 #include <CoreFoundation/CoreFoundation.h>
 #include <Foundation/Foundation.h>
 
-#if !defined(__arm__) && !defined(__arm64__)
-#include <Carbon/Carbon.h>
-#endif
-
 #ifndef _POSIX_SPAWN_DISABLE_ASLR
 #define _POSIX_SPAWN_DISABLE_ASLR       0x0100
 #endif
@@ -861,72 +857,30 @@ Host::OpenFileInExternalEditor (const FileSpec &file_spec, uint32_t line_no)
     
     if (using_xcode)
     {
-        static ComponentInstance osa_component = NULL;
-        static const char *as_template = "tell application \"Xcode\"\n"
-                                   "set doc to the first document whose path is \"%s\"\n"
-                                   "set the selection to paragraph %d of doc\n"
-                                   "--- set the selected paragraph range to {%d, %d} of doc\n"
-                                   "end tell\n";
-        const int chars_for_int = 32;
-        static int as_template_len = strlen (as_template);
-
-      
-        char *as_str;
-        AEDesc as_desc;
-      
-        if (osa_component == NULL)
-        {
-            osa_component = ::OpenDefaultComponent (kOSAComponentType,
-                                                    kAppleScriptSubtype);
-        }
-        
-        if (osa_component == NULL)
-        {
-            if (log)
-                log->Printf("Could not get default AppleScript component.\n");
-            return false;
-        }
-
-        uint32_t as_str_size = as_template_len + strlen (file_path) + 3 * chars_for_int + 1;     
-        as_str = (char *) malloc (as_str_size);
-        ::snprintf (as_str, 
-                    as_str_size - 1, 
-                    as_template, 
-                    file_path, 
-                    line_no, 
-                    line_no, 
-                    line_no);
-
-        error = ::AECreateDesc (typeChar, 
-                                as_str, 
-                                strlen (as_str),
-                                &as_desc);
-        
-        ::free (as_str);
-
-        if (error != noErr)
-        {
-            if (log)
-                log->Printf("Failed to create AEDesc for Xcode AppleEvent: %ld.\n", error);
-            return false;
-        }
-            
-        OSAID ret_OSAID;
-        error = ::OSACompileExecute (osa_component, 
-                                     &as_desc, 
-                                     kOSANullScript, 
-                                     kOSAModeNeverInteract, 
-                                     &ret_OSAID);
-        
-        ::OSADispose (osa_component, ret_OSAID);
-
-        ::AEDisposeDesc (&as_desc);
+        @autoreleasepool {
+            NSString *as_str = [NSString stringWithFormat:@"tell application \"Xcode\"\n"
+                                "set doc to the first document whose path is \"%s\"\n"
+                                "set the selection to paragraph %d of doc\n"
+                                "--- set the selected paragraph range to {%d, %d} of doc\n"
+                                "end tell\n", file_path, line_no, line_no, line_no];
+            NSAppleScript *as = [[NSAppleScript alloc] initWithSource:as_str];
+
+            if (!as)
+            {
+                if (log)
+                    log->Printf("Failed to create AppleScript for Xcode AppleEvent.\n");
+                return false;
+            }
 
-        if (error != noErr)
-        {
-            if (log)
-                log->Printf("Sending AppleEvent to Xcode failed, error: %ld.\n", error);
-            return false;
+            NSDictionary *error = nil;
+            if (![as executeAndReturnError:&error])
+            {
+                if (log)
+                    log->Printf("Sending AppleEvent to Xcode failed, error: %s.\n", [[error description] UTF8String]);
+                [as release];
+                return false;
+            }
+            [as release];
         }
     }
     return true;
