# HG changeset patch # User Andrew Choi # Date 1024293963 0 # Node ID 7b1f766314f674aad533453ab81e1d594364279f # Parent e17ed720205d26800103254e884acb167b3dabe1 2002-06-17 Andrew Choi * 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. diff -r e17ed720205d -r 7b1f766314f6 src/ChangeLog --- a/src/ChangeLog Mon Jun 17 01:45:48 2002 +0000 +++ b/src/ChangeLog Mon Jun 17 06:06:03 2002 +0000 @@ -1,3 +1,10 @@ +2002-06-17 Andrew Choi + + * 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 * macterm.c (XTread_socket): Call FrontNonFloatingWindow instead diff -r e17ed720205d -r 7b1f766314f6 src/mac.c --- a/src/mac.c Mon Jun 17 01:45:48 2002 +0000 +++ b/src/mac.c Mon Jun 17 06:06:03 2002 +0000 @@ -2446,6 +2446,9 @@ *result = 0; + if (!as_scripting_component) + initialize_applescript(); + error = AECreateDesc (typeChar, script, strlen(script), &script_desc); if (error) return error; @@ -2502,10 +2505,10 @@ } 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 @@ if (status) { if (!result) - error ("AppleScript error %ld", status); + error ("AppleScript error %d", status); else { /* Unfortunately only OSADoScript in do_applescript knows how