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 Unified Diffs Ignore Whitespace Patch

Changes to aem/macosx/aem.c.

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
 			   
    AEGetDescData(&directParameter, paramstring, size);
    AEDisposeDesc(&directParameter);

    /*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.*/

    CFStringRef arg = CFStringCreateWithBytes(0, paramstring, sizeof(paramstring), kCFStringEncodingUTF8, false);
    
    // as_arg = CFStringGetCStringPtr(arg, kCFStringEncodingUTF8);
    CFIndex stringLengthIndex = CFStringGetLength(arg);
     CFStringGetCString(arg, as_arg, stringLengthIndex,  kCFStringEncodingUTF8);

     fprintf(stdout, "the arg is %s\n", as_arg);
    CFRelease(arg);
  } else {
    as_arg  = " ";
    fprintf(stdout, "the null arg is %s\n", as_arg);
  }
   
  /*  Get command keyed to eventID from dict and pass to Tcl for execution. */
  CFTypeRef scriptName;
  stringeventID = UTCreateStringForOSType(eventID);
  scriptName = CFDictionaryGetValue(aeDict, stringeventID);
  CFStringRef cfcmd;







|
|
|
|
|
<



<







90
91
92
93
94
95
96
97
98
99
100
101

102
103
104

105
106
107
108
109
110
111
 			   
    AEGetDescData(&directParameter, paramstring, size);
    AEDisposeDesc(&directParameter);

    /*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.*/

    CFStringRef arg = CFStringCreateWithBytes(0, paramstring, sizeof(paramstring), kCFStringEncodingUTF8, false);
    CFDataRef data;
    data = CFStringCreateExternalRepresentation(NULL, arg, kCFStringEncodingUTF8, 0);
    if (data) {
      as_arg = (const char *)CFDataGetBytePtr(data);
    }

    CFRelease(arg);
  } else {
    as_arg  = " ";

  }
   
  /*  Get command keyed to eventID from dict and pass to Tcl for execution. */
  CFTypeRef scriptName;
  stringeventID = UTCreateStringForOSType(eventID);
  scriptName = CFDictionaryGetValue(aeDict, stringeventID);
  CFStringRef cfcmd;
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
  /* Convert the string reference into a C string. */
  applescript_tcl_cmd = CFStringGetCStringPtr(cfcmd, kCFStringEncodingUTF8);
  
  /* Build the command to eval. */

  Tcl_DStringAppend(&as_cmd, applescript_tcl_cmd, -1);
  Tcl_DStringAppend(&as_cmd, " ", -1);
  /* Tcl_DStringAppend(&as_cmd, as_arg, -1); */
  
  /* Eval the Tcl command. */
  Tcl_Eval(AS_Interp, Tcl_DStringValue(&as_cmd));
  Tcl_DStringFree(&as_cmd);
 
  char *output;
  output = Tcl_GetString(Tcl_GetObjResult(AS_Interp));







|







126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
  /* Convert the string reference into a C string. */
  applescript_tcl_cmd = CFStringGetCStringPtr(cfcmd, kCFStringEncodingUTF8);
  
  /* Build the command to eval. */

  Tcl_DStringAppend(&as_cmd, applescript_tcl_cmd, -1);
  Tcl_DStringAppend(&as_cmd, " ", -1);
  Tcl_DStringAppend(&as_cmd, as_arg, -1);
  
  /* Eval the Tcl command. */
  Tcl_Eval(AS_Interp, Tcl_DStringValue(&as_cmd));
  Tcl_DStringFree(&as_cmd);
 
  char *output;
  output = Tcl_GetString(Tcl_GetObjResult(AS_Interp));