--- plug-ins/script-fu/Makefile.am.orig	2012-05-08 08:05:46.000000000 +0200
+++ plug-ins/script-fu/Makefile.am	2012-11-11 12:16:20.000000000 +0100
@@ -1,5 +1,10 @@
 ## Process this file with automake to produce Makefile.in
 
+if PLATFORM_OSX
+xobjective_c = "-xobjective-c"
+framework_cocoa = -framework Cocoa
+endif
+
 if OS_WIN32
 mwindows = -mwindows
 WINSOCK_LIBS = -lws2_32
@@ -26,12 +31,16 @@
 AM_CFLAGS = \
 	-DSTANDALONE=0     \
 	-DUSE_INTERFACE=1  \
-	-DUSE_STRLWR=0     \
+	-DUSE_STRLWR=0     
+  
+INCLUDES = \
 	-I$(top_srcdir)    \
 	$(GTK_CFLAGS)      \
-	-I$(includedir)
+	-I$(includedir) \
+  $(xobjective_c)
 
-AM_LDFLAGS = $(mwindows)
+AM_LDFLAGS = $(mwindows) \
+  $(framework_cocoa)
 
 SUBDIRS = tinyscheme ftx scripts
 
--- plug-ins/script-fu/script-fu-interface.c.orig	2012-03-12 20:18:11.000000000 +0100
+++ plug-ins/script-fu/script-fu-interface.c	2012-11-12 19:45:34.000000000 +0100
@@ -33,6 +33,9 @@
 
 #include "script-fu-intl.h"
 
+#ifdef GDK_WINDOWING_QUARTZ
+#import <Cocoa/Cocoa.h>
+#endif
 
 #define RESPONSE_RESET         1
 
@@ -583,6 +586,11 @@ script_fu_interface (SFScript  *script,
 
   gtk_widget_show (dialog);
 
+#ifdef GDK_WINDOWING_QUARTZ
+  /* this shows the dialogs on repeated plug-in calls */
+  [NSApp arrangeInFront: nil];
+#endif
+
   gtk_main ();
 
   return sf_status;
@@ -737,10 +745,18 @@ script_fu_response (GtkWidget *widget,
       gtk_widget_set_sensitive (action_area, FALSE);
 
       script_fu_ok (script);
+#ifdef GDK_WINDOWING_QUARTZ
+      [NSApp hide: nil];
+      gtk_main_iteration ();
+#endif
       gtk_widget_destroy (sf_interface->dialog);
       break;
 
     default:
+#ifdef GDK_WINDOWING_QUARTZ
+      [NSApp hide: nil];
+      gtk_main_iteration ();
+#endif
       sf_status = GIMP_PDB_CANCEL;
       gtk_widget_destroy (sf_interface->dialog);
       break;
