Skip to content

Commit

Permalink
2002-06-17 Andrew Choi <akochoi@shaw.ca>
Browse files Browse the repository at this point in the history
        * 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.
  • Loading branch information
Andrew Choi committed Jun 17, 2002
1 parent 324663e commit 4d67b8b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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
Expand Down

0 comments on commit 4d67b8b

Please sign in to comment.