Re: running scripts
Re: running scripts
- Subject: Re: running scripts
- From: Ian Anderson <email@hidden>
- Date: Sat, 16 Jul 2005 16:04:17 -0700
You want NSAppleScript, http://developer.apple.com/documentation/
Cocoa/Reference/Foundation/ObjC_classic/Classes/NSAppleScript.html .
This should get you started:
void RunAppleScript(NSString *scriptName)
{
NSString *scriptLocation;
NSURL *scriptURL;
NSAppleScript *appleScript;
NSDictionary *errorDictionary;
NSAppleEventDescriptor *result;
scriptLocation = [[NSBundle mainBundle]
pathForResource:scriptName ofType:@"scpt"
inDirectory:@"Scripts"];
scriptURL = [NSURL fileURLWithPath:scriptLocation];
appleScript = [[NSAppleScript alloc]
initWithContentsOfURL:scriptURL error:&errorDictionary];
result = [appleScript executeAndReturnError:&errorDictionary];
[appleScript release];
}
Ian
Hi, I've just joined the list and wondered if anyone could help me
out here.
Basically, I have written a nice little timer application called
Pause. However, I wish to add to it the ability to run an
applescript (the script is already saved to disk) of the users
choice. I am sure I have seen how to do this before elsewhere, but
no amount of googling or searching of various web-sites has been
able to find me an answer :(
So, does anyone know how to run an existing applescript from either
Obj-C or Applescript itself please?
Thanks very much in advance,
Mike Abdullah.
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden