diff options
author | Andrew Choi <akochoi@shaw.ca> | 2002-06-17 06:06:03 +0000 |
---|---|---|
committer | Andrew Choi <akochoi@shaw.ca> | 2002-06-17 06:06:03 +0000 |
commit | 84c0c2cc3c5a51044efe9521d9b9a2cb4d268ce8 (patch) | |
tree | b7285baf56ac741386efe51ded1a305fcc4b0017 /src | |
parent | b6cce0b720b44fcf8a8aa6e20ff1a1be2c605b94 (diff) | |
download | emacs-84c0c2cc3c5a51044efe9521d9b9a2cb4d268ce8.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/mac.c | 7 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 080c2d26502..8ce5a257d91 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 diff --git a/src/mac.c b/src/mac.c index c7a9cd35f28..4a97b0d7dd9 100644 --- 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 |