Skip navigation.
 
mlRe: Services menu invoke from the command line?
FROM : Douglas Davidson
DATE : Thu Jun 19 19:11:05 2008

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

Related mailsAuthorDate
mlServices menu invoke from the command line? Glen Low Jun 19, 03:01
mlRe: Services menu invoke from the command line? Douglas Davidson Jun 19, 19:11