Redirecting screencapture output
Redirecting screencapture output
- Subject: Redirecting screencapture output
- From: Lorenzo <email@hidden>
- Date: Wed, 21 Jul 2004 15:29:19 +0200
Hi,
as you know the unix command "screencapture" saves the main screen content
to a PDF file or to the clipboard. Instead I would like to don't save any
file (it's slow), don't occupy the clipboard, but I would like to get that
output in a NSData or NSImage variable in my application. Is any way to do
that? Piping the command? If so, I don't know the sintax.
Can someone help me?
Actually I call
NSArray *args;
args = [NSArray arrayWithObjects:@"-x", @"-m", @"filePath", nil];
I tried even to add
NSPipe *myPipe = [NSPipe pipe];
[task setStandardOutput:myPipe];
but the length of
NSData *dataOut = [[[task standardOutput] fileHandleForReading]
availableData];
is zero. And the file has been saved anyway.
I tried also the following unsuccessfully. I don't know the syntax.
args = [NSArray arrayWithObjects:@"-x", @"-m", @"|", nil];
What should I write after the pipe "|" ?
Any code would be welcome. Thanks.
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.