• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Redirecting screencapture output
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redirecting screencapture output


  • Subject: Re: Redirecting screencapture output
  • From: Yann Bizeul <email@hidden>
  • Date: Thu, 22 Jul 2004 13:22:38 +0200

As far as I know, screencapture does not provide a way to pipe its
result to stdout.
An ugly workaround would be to create a fifo in /tmp/ and save the
result to this fifo. You would be able to read the fifo to get the file
back. Like this, you won't have file operation overhead.

Personaly, I would write the screen to /tmp and read it back with
NSImage, If I don not find a way to handle the screen capture all by
myself.

Le 21 juil. 04, ` 15:29, Lorenzo a icrit :

> 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.
>
>
>
--
Yann Bizeul - yann at tynsoe.org
http://projects.tynsoe.org/
_______________________________________________
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.


  • Follow-Ups:
    • Re: Redirecting screencapture output
      • From: David Blanton <email@hidden>
    • Re: Redirecting screencapture output
      • From: Lorenzo <email@hidden>
References: 
 >Redirecting screencapture output (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: Tiger for ASD?
  • Next by Date: Re: IOBluetooth questions
  • Previous by thread: Redirecting screencapture output
  • Next by thread: Re: Redirecting screencapture output
  • Index(es):
    • Date
    • Thread