Re: Services menu invoke from the command line?
Re: Services menu invoke from the command line?
- Subject: Re: Services menu invoke from the command line?
- From: Douglas Davidson <email@hidden>
- Date: Thu, 19 Jun 2008 10:11:05 -0700
On Jun 18, 2008, at 6:01 PM, Glen Low wrote:
Is there any command-line tool that will invoke a Services menu
command with standard input as the data to be transformed?
Not that I know of, but it should be pretty easy to write one.
Invoking a service with a string looks something like this:
NSPasteboard *pboard = [NSPasteboard pasteboardWithUniqueName];
[pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType]
owner:nil];
[pboard setString:@"Hello, world" forType:NSStringPboardType];
NSPerformService(@"Mail/Send Selection", pboard);
Douglas Davidson
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden