Tk-Components

Check-in [1d1a58d84a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:aem implementation now complete, need further testing and documentation before formal release
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1d1a58d84a17f933b0cec2a9a8d1dd2fb150ac33
User & Date: kevin 2015-07-13 06:45:07
Context
2015-07-23
01:33
Add documentation for aem; ready for 1.0 release check-in: 24d8673482 user: kevin tags: trunk
2015-07-13
06:45
aem implementation now complete, need further testing and documentation before formal release check-in: 1d1a58d84a user: kevin tags: trunk
03:25
aem changes check-in: 1554d3738e user: kevin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to aem/macosx/aem.c.

    90     90    			   
    91     91       AEGetDescData(&directParameter, paramstring, size);
    92     92       AEDisposeDesc(&directParameter);
    93     93   
    94     94       /*Need to convert paramstring to something Tcl can handle gracefully. Direct conversion of AE params to char does not seem to work well, produces garbage.*/
    95     95   
    96     96       CFStringRef arg = CFStringCreateWithBytes(0, paramstring, sizeof(paramstring), kCFStringEncodingUTF8, false);
    97         -    
    98         -    // as_arg = CFStringGetCStringPtr(arg, kCFStringEncodingUTF8);
    99         -    CFIndex stringLengthIndex = CFStringGetLength(arg);
   100         -     CFStringGetCString(arg, as_arg, stringLengthIndex,  kCFStringEncodingUTF8);
   101         -
   102         -     fprintf(stdout, "the arg is %s\n", as_arg);
           97  +    CFDataRef data;
           98  +    data = CFStringCreateExternalRepresentation(NULL, arg, kCFStringEncodingUTF8, 0);
           99  +    if (data) {
          100  +      as_arg = (const char *)CFDataGetBytePtr(data);
          101  +    }
   103    102       CFRelease(arg);
   104    103     } else {
   105    104       as_arg  = " ";
   106         -    fprintf(stdout, "the null arg is %s\n", as_arg);
   107    105     }
   108    106      
   109    107     /*  Get command keyed to eventID from dict and pass to Tcl for execution. */
   110    108     CFTypeRef scriptName;
   111    109     stringeventID = UTCreateStringForOSType(eventID);
   112    110     scriptName = CFDictionaryGetValue(aeDict, stringeventID);
   113    111     CFStringRef cfcmd;
................................................................................
   128    126     /* Convert the string reference into a C string. */
   129    127     applescript_tcl_cmd = CFStringGetCStringPtr(cfcmd, kCFStringEncodingUTF8);
   130    128     
   131    129     /* Build the command to eval. */
   132    130   
   133    131     Tcl_DStringAppend(&as_cmd, applescript_tcl_cmd, -1);
   134    132     Tcl_DStringAppend(&as_cmd, " ", -1);
   135         -  /* Tcl_DStringAppend(&as_cmd, as_arg, -1); */
          133  +  Tcl_DStringAppend(&as_cmd, as_arg, -1);
   136    134     
   137    135     /* Eval the Tcl command. */
   138    136     Tcl_Eval(AS_Interp, Tcl_DStringValue(&as_cmd));
   139    137     Tcl_DStringFree(&as_cmd);
   140    138    
   141    139     char *output;
   142    140     output = Tcl_GetString(Tcl_GetObjResult(AS_Interp));