Skip navigation.
 
mlRemove the GUI > Revert applications to command-line binaries.
FROM : Pippo
DATE : Mon Apr 21 19:15:51 2008

Hello,

I have built and runt the OpenGLScreenSnapshot app successfully using 
the sample code available here:
http://devworld.apple.com/samplecode/OpenGLScreenSnapshot/index.html

The app permits to take a picture of the screen.

While running the OpenGLScreenSnapshot app, one must select the 
menubar and then select the 'Screen Snapshot' submenu in order to 
take a picture.

Instead my intention is to modify the code in order to let the app 
launch, take a snapshot saving to a custom location, and then close 
automatically.

I am aware of many ways to do the same thing using different methods 
(i.e. via command-line, applescript, keyboard shorcuts, etc), but I 
am posting here cause I would love to learn about how to modify the 
exact code used in the OpenGLScreenSnapshot.xcodeproj.

Reading the MyController.m I find:
------------------------------------------------------
- (IBAction)screenSnapshot:(id)sender

[...]
------------------------------------------------------

I am sure there are at least two solutions to the "quest" I am 
offering you:

[1] Adding the correct code would be possible to supersede the 
IBAction, letting a custom executable handling the events?

[2] Adding a command-line tool as new target, inserting the correct 
code after  "int main( int argc, char *argv[] ) ... " and completely 
removing the nib?

Maybe the NSApplicationLoad(); class could be of help when using the 
g_autoReleasePool.

However, I do not know which are the correct command-line args to add.

Regards, Pippo

Related mailsAuthorDate
No related mails found.