]> code.delx.au - gnu-emacs/commitdiff
2002-06-17 Andrew Choi <akochoi@shaw.ca>
authorAndrew Choi <akochoi@shaw.ca>
Mon, 17 Jun 2002 06:06:03 +0000 (06:06 +0000)
committerAndrew Choi <akochoi@shaw.ca>
Mon, 17 Jun 2002 06:06:03 +0000 (06:06 +0000)
        * mac.c (do_applescript): Call initialize_applescript if necessary
        when first called.  Dispose of result_desc only when there is no
        error.
        (Fdo_applescript): Use %d format specifier instead of %ld.

src/ChangeLog
src/mac.c

index 080c2d26502a6682f3010e1ad5bb4d6073d6b47c..8ce5a257d918070c81f30fa3d94bca3721741c34 100644 (file)
@@ -1,3 +1,10 @@
+2002-06-17  Andrew Choi  <akochoi@shaw.ca>
+
+       * mac.c (do_applescript): Call initialize_applescript if necessary
+       when first called.  Dispose of result_desc only when there is no
+       error.
+       (Fdo_applescript): Use %d format specifier instead of %ld.
+       
 2002-06-16  Andrew Choi  <akochoi@shaw.ca>
 
        * macterm.c (XTread_socket): Call FrontNonFloatingWindow instead
index c7a9cd35f2872336d3e0332825ca3a2a4d233bac..4a97b0d7dd94dd003fda10c286586076ba71843e 100644 (file)
--- a/src/mac.c
+++ b/src/mac.c
@@ -2446,6 +2446,9 @@ do_applescript (char *script, char **result)
 
   *result = 0;
 
+  if (!as_scripting_component)
+    initialize_applescript();
+
   error = AECreateDesc (typeChar, script, strlen(script), &script_desc);
   if (error)
     return error;
@@ -2502,10 +2505,10 @@ do_applescript (char *script, char **result)
         }
       HUnlock (result_desc.dataHandle);
 #endif /* not TARGET_API_MAC_CARBON */
+      AEDisposeDesc (&result_desc);
     }
 
   AEDisposeDesc (&script_desc);
-  AEDisposeDesc (&result_desc);    
 
   return osaerror;
 }
@@ -2530,7 +2533,7 @@ component.  */)
   if (status)
     {
       if (!result)
-        error ("AppleScript error %ld", status);
+        error ("AppleScript error %d", status);
       else
         {
           /* Unfortunately only OSADoScript in do_applescript knows how