| 1 | /*
|
|---|
| 2 | * doscript.c
|
|---|
| 3 | * PythonLauncher
|
|---|
| 4 | *
|
|---|
| 5 | * Created by Jack Jansen on Wed Jul 31 2002.
|
|---|
| 6 | * Copyright (c) 2002 __MyCompanyName__. All rights reserved.
|
|---|
| 7 | *
|
|---|
| 8 | */
|
|---|
| 9 |
|
|---|
| 10 | #import <Cocoa/Cocoa.h>
|
|---|
| 11 | #import <ApplicationServices/ApplicationServices.h>
|
|---|
| 12 | #import "doscript.h"
|
|---|
| 13 |
|
|---|
| 14 | /* I assume I could pick these up from somewhere, but where... */
|
|---|
| 15 | #define CREATOR 'trmx'
|
|---|
| 16 |
|
|---|
| 17 | #define ACTIVATE_CMD 'misc'
|
|---|
| 18 | #define ACTIVATE_SUITE 'actv'
|
|---|
| 19 |
|
|---|
| 20 | #define DOSCRIPT_CMD 'dosc'
|
|---|
| 21 | #define DOSCRIPT_SUITE 'core'
|
|---|
| 22 | #define WITHCOMMAND 'cmnd'
|
|---|
| 23 |
|
|---|
| 24 | /* ... and there's probably also a better way to do this... */
|
|---|
| 25 | #define START_TERMINAL "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal &"
|
|---|
| 26 |
|
|---|
| 27 | extern int
|
|---|
| 28 | doscript(const char *command)
|
|---|
| 29 | {
|
|---|
| 30 | OSErr err;
|
|---|
| 31 | AppleEvent theAEvent, theReply;
|
|---|
| 32 | AEAddressDesc terminalAddress;
|
|---|
| 33 | AEDesc commandDesc;
|
|---|
| 34 | OSType terminalCreator = CREATOR;
|
|---|
| 35 |
|
|---|
|
|---|