Tk-Components

Check-in [19a8a45d31]
Login

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

Overview
Comment:More updates to aem
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 19a8a45d312235fbc32c7a4cf72fd2b9c9147283
User & Date: kevin 2015-07-12 04:09:34
Context
2015-07-13
03:25
aem changes check-in: 1554d3738e user: kevin tags: trunk
2015-07-12
04:09
More updates to aem check-in: 19a8a45d31 user: kevin tags: trunk
03:42
Updates to launcher module check-in: 5da1731fb5 user: kevin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to aem/macosx/aem.c.

95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
  CFStringRef arg = CFStringCreateWithBytes(0, paramstring, sizeof(paramstring),
					    kCFStringEncodingUTF8, false);
  int len; 
  len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(arg), kCFStringEncodingUTF8);
  Tcl_DStringInit(&as_arg);
  Tcl_DStringSetLength(&as_arg, len);

  Tcl_DStringValue(&as_arg) = CFStringGetCStringPtr(arg,kCFStringEncodingUTF8);
   
  /*  Get command keyed to eventID from dict and pass to Tcl for execution. */
  CFTypeRef scriptName;
  stringeventID = UTCreateStringForOSType(eventID);
  scriptName = CFDictionaryGetValue(aeDict, stringeventID);
  CFStringRef cfcmd;
  if (scriptName == NULL) {







|







95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
  CFStringRef arg = CFStringCreateWithBytes(0, paramstring, sizeof(paramstring),
					    kCFStringEncodingUTF8, false);
  int len; 
  len = CFStringGetMaximumSizeForEncoding(CFStringGetLength(arg), kCFStringEncodingUTF8);
  Tcl_DStringInit(&as_arg);
  Tcl_DStringSetLength(&as_arg, len);

  Tcl_DStringValue(&as_arg) = CFStringGetCStringPtr(arg, kCFStringEncodingUTF8);
   
  /*  Get command keyed to eventID from dict and pass to Tcl for execution. */
  CFTypeRef scriptName;
  stringeventID = UTCreateStringForOSType(eventID);
  scriptName = CFDictionaryGetValue(aeDict, stringeventID);
  CFStringRef cfcmd;
  if (scriptName == NULL) {
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
  /*  Pass results back to AppleScript, clean up. */
  err= AEPutParamPtr(reply, keyDirectObject, typeUTF8Text, output, strlen(output));
  if (err !=noErr) {
    fprintf(stderr, "Unable to execute %s\n", applescript_tcl_cmd);
  }
  CFRelease(scriptName);
  CFRelease(arg);
  Tcl_DStringFree(&as_arg);
  return err;
}

  
/*Initalize the package in the tcl interpreter, create Tcl commands. */
int Aem_Init (Tcl_Interp *interp) {








<







134
135
136
137
138
139
140

141
142
143
144
145
146
147
  /*  Pass results back to AppleScript, clean up. */
  err= AEPutParamPtr(reply, keyDirectObject, typeUTF8Text, output, strlen(output));
  if (err !=noErr) {
    fprintf(stderr, "Unable to execute %s\n", applescript_tcl_cmd);
  }
  CFRelease(scriptName);
  CFRelease(arg);

  return err;
}

  
/*Initalize the package in the tcl interpreter, create Tcl commands. */
int Aem_Init (Tcl_Interp *interp) {

Changes to launcher/launcher.html.

1



2


3
4



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20


21







22
23


24

25
26
27
28
29
30
31



32
33
34
35
36
37
38
39
<HTML>



<BODY>


<PRE>
<!-- Manpage converted by man2html 3.0.1 -->



package require launcher
.PP
launcher::launchurl url?
.PP
launcher::launchfile file?
.PP
launcher::getapppath
.PP
launcher::getdefaultapp url
.PP
launcher::setdefaultapp url path-to-app
.RE
.PP

.SH DESCRIPTION



This module allows you to launch a URL or a file on the Mac using the system's default application for that URL or file type. It provides similar functionality to the "/usr/bin/open" command-line tool, but works without shelling out to an external program. The package also allows you to query the system for a default app for a particular URL type, i.e. http://, and also to set the default app for a particular URL. Finally, the module provides a convenience function to get the current app path.







.SH EXAMPLES



launcher::launchurl http://www.apple.com

launcher::launch file ~/Desktop/test.txt
launcher::getapppath
launcher::getdefaultapp http
launcher::setdefaultapp x-man-page [launcher::getapppath]
.RE
.PP




</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>

>
>
>

>
>


>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|

<

>
>
|
>
>
>
>
>
>
>
|

>
>
|
>
|
|
|
|
|
|

>
>
>








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<HTML>
<HEAD>
<TITLE>launcher</TITLE>
</HEAD>
<BODY>
<H1>launcher</H1>
<HR>
<PRE>
<!-- Manpage converted by man2html 3.0.1 -->

</PRE>
<H2>SYNPOSIS</H2><PRE>
       package require launcher

       launcher::launchurl url?

       launcher::launchfile file?

       launcher::getapppath

       launcher::getdefaultapp url

       launcher::setdefaultapp url path-to-app





</PRE>
<H2>DESCRIPTION</H2><PRE>
       This  module  allows you to launch a URL or a file on the Mac using the
       system's default application for that URL or  file  type.  It  provides
       similar  functionality  to  the  "/usr/bin/open" command-line tool, but
       works without shelling out to an external  program.  The  package  also
       allows  you  to query the system for a default app for a particular URL
       type, i.e. http://, and also to set the default app  for  a  particular
       URL.  Finally,  the  module  provides a convenience function to get the
       current app path.


</PRE>
<H2>EXAMPLES</H2><PRE>
       launcher::launchurl http://www.apple.com

       launcher::launch file ~/Desktop/test.txt

       launcher::getapppath launcher::getdefaultapp http launcher::setdefault-
       app x-man-page [launcher::getapppath]





                                                        launcher(11 July 2015)
</PRE>
<HR>
<ADDRESS>
Man(1) output converted with
<a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
</ADDRESS>
</BODY>
</HTML>

Changes to launcher/launcher.n.

1
2
3
4
5
6
7
8
9
.\" Text automatically generated by txt2man
.TH untitled  "11 July 2015" "" ""
.SH NAME
\fBlauncher
\fB
.SH SYNPOSIS

package require launcher
.PP

|







1
2
3
4
5
6
7
8
9
.\" Text automatically generated by txt2man
.TH launcher "11 July 2015" "" ""
.SH NAME
\fBlauncher
\fB
.SH SYNPOSIS

package require launcher
.PP
21
22
23
24
25
26
27

28

29
30
31
32
33
34

.SH DESCRIPTION

This module allows you to launch a URL or a file on the Mac using the system's default application for that URL or file type. It provides similar functionality to the "/usr/bin/open" command-line tool, but works without shelling out to an external program. The package also allows you to query the system for a default app for a particular URL type, i.e. http://, and also to set the default app for a particular URL. Finally, the module provides a convenience function to get the current app path.
.SH EXAMPLES

launcher::launchurl http://www.apple.com

launcher::launch file ~/Desktop/test.txt

launcher::getapppath
launcher::getdefaultapp http
launcher::setdefaultapp x-man-page [launcher::getapppath]
.RE
.PP








>

>






21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

.SH DESCRIPTION

This module allows you to launch a URL or a file on the Mac using the system's default application for that URL or file type. It provides similar functionality to the "/usr/bin/open" command-line tool, but works without shelling out to an external program. The package also allows you to query the system for a default app for a particular URL type, i.e. http://, and also to set the default app for a particular URL. Finally, the module provides a convenience function to get the current app path.
.SH EXAMPLES

launcher::launchurl http://www.apple.com

launcher::launch file ~/Desktop/test.txt

launcher::getapppath
launcher::getdefaultapp http
launcher::setdefaultapp x-man-page [launcher::getapppath]
.RE
.PP

Changes to launcher/launcher.txt.

18
19
20
21
22
23
24
25

26

27

28

29
30
31

DESCRIPTION

This module allows you to launch a URL or a file on the Mac using the system's default application for that URL or file type. It provides similar functionality to the "/usr/bin/open" command-line tool, but works without shelling out to an external program. The package also allows you to query the system for a default app for a particular URL type, i.e. http://, and also to set the default app for a particular URL. Finally, the module provides a convenience function to get the current app path.

EXAMPLES

 launcher::launchurl http://www.apple.com

 launcher::launch file ~/Desktop/test.txt

 launcher::getapppath

 launcher::getdefaultapp http

 launcher::setdefaultapp x-man-page [launcher::getapppath]









|
>
|
>
|
>
|
>



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

DESCRIPTION

This module allows you to launch a URL or a file on the Mac using the system's default application for that URL or file type. It provides similar functionality to the "/usr/bin/open" command-line tool, but works without shelling out to an external program. The package also allows you to query the system for a default app for a particular URL type, i.e. http://, and also to set the default app for a particular URL. Finally, the module provides a convenience function to get the current app path.

EXAMPLES

launcher::launchurl http://www.apple.com

launcher::launch file ~/Desktop/test.txt

launcher::getapppath

launcher::getdefaultapp http

 launcher::setdefaultapp x-man-page [launcher::getapppath]