Re: Screenshots in Mac OS X
Well, I'm not going to post my whole module as I get little testing on mac, but I will let you in on a little secret: Use a GUI, such as wxPython or QT or other, then create a basic fullscreen frame that is invisible and copy its DC to the clipboard. Not exactly a hack(might be edgy), but it works. Writing the gui/logic code will be up to you. here is a basic wx example f = wxFrame(None, -1) f.Show(True) f.SetTransparent(0) # Bind your hotkeys to capture the screen. Also, not sure ATM... but I recall someone wrote a cross platform screenshot implementation IIRC that replaces PIL's ImageGrab module, I think it is pyscreenshot or something similar. You might want to look into that. -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
On 23/10/2013 01:22, Pratik Mehta wrote: Hey Mark, Thanks for reverting. I had tried coding it using os.system("screencapture -s /filepath") // for selecting a particular region.. I have replied to Kevin's comment, that's exactly what I am looking for. :) Thanks ... Assuming that you're talking to me, no problem. Do you mean "replying" and not "reverting", as I observe that you've used this elsewhere? -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
On 10/22/13 8:19 PM, Pratik Mehta wrote: Hey Kevin, Thanks for reverting. I know about the "screencapture" function and the parameters available. But, how would I take the user input, as in, that is just command-line, as soon as I execute the program, it will take whatever kind of parameter is passed under screencapture. I want that, in the same program, if the user presses Shift+Command+3, whole screenshot should be taken. When, Shift + Command + 4 is pressed, a particular frame should be displayed to select the area / region. Also, I want to create my own command : Shift + Command + 5 ==> this is specially for web browser, whenever I press this key on any of the web-page, the whole web page should be grabbed along with its snapshot, and snapshot's filename should be web-page's url which I am currently on. Also, this process should be executing at the backend, so that, whenever these keys are pressed, it overrides the system's functionality and uses mine. There are no simple answers to these questions. With Tkinter, it's possible to code a basic UI and bind combinations of specific keys to trigger specific callbacks, which can fire specific sequences of arguments to the screencapture CLI tool. That's the quick and dirty way. I'm not going to write this code for you. Look at TkDocs.com and effbot's site for an introduction to Tkinter. If you are not looking for a GUI app to do this, but some sort of system-level daemon, that requires a lower level of coding. You'll need to look at such system frameworks as CoreGraphics and Cocoa to find the API's you need. PyObjC (Python binding to Cocoa) can probably be helpful here. Frankly, I'm not sure Python is the best tool here, but if you go this route, you want a Python API that hews as closely to the system-level calls as possible, and PyObjC will likely be your best path here. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
Hey Mark, Thanks for reverting. I had tried coding it using os.system("screencapture -s /filepath") // for selecting a particular region.. I have replied to Kevin's comment, that's exactly what I am looking for. :) Thanks ... -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
Hey Kevin, Thanks for reverting. I know about the "screencapture" function and the parameters available. But, how would I take the user input, as in, that is just command-line, as soon as I execute the program, it will take whatever kind of parameter is passed under screencapture. I want that, in the same program, if the user presses Shift+Command+3, whole screenshot should be taken. When, Shift + Command + 4 is pressed, a particular frame should be displayed to select the area / region. Also, I want to create my own command : Shift + Command + 5 ==> this is specially for web browser, whenever I press this key on any of the web-page, the whole web page should be grabbed along with its snapshot, and snapshot's filename should be web-page's url which I am currently on. Also, this process should be executing at the backend, so that, whenever these keys are pressed, it overrides the system's functionality and uses mine. -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
Hey John, I want to code my own Snapshot taking program using Python. Hence, had posted this question... -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
On 10/22/13 6:08 PM, Kevin Walzer wrote: On 10/22/13 4:15 PM, Pratik Mehta wrote: Anyone there to help me out??? import os os.system('screencapture', 'foo.png') ...and see 'man screencapture' for options. I leave setting up a Tkinter GUI with proper key bindings as an exercise for the reader. -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
On 10/22/13 4:15 PM, Pratik Mehta wrote: Anyone there to help me out??? import os os.system('screencapture', 'foo.png') -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
In <03db6a3f-3b1c-4516-8bee-4e3a362eb...@googlegroups.com> Pratik Mehta writes: > Anyone there to help me out??? Command-Shift-3 takes a screenshot of the whole screen and saves it as a file on the desktop. Command-Control-Shift-3: takes a screenshot of the whole screen and saves it to the clipboard. For other options (such as taking a screenshot of a window or a specific region on the screen), see http://guides.macrumors.com/Taking_Screenshots_in_Mac_OS_X I wonder what this has to do with Python though. -- John Gordon Imagine what it must be like for a real medical doctor to gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
On 22/10/2013 21:15, Pratik Mehta wrote: Anyone there to help me out??? There are plenty of people who will help you out, but if and only if you make an attempt at writing some code and then ask for assistance when you run into problems. -- Python is the second best programming language in the world. But the best has yet to be invented. Christian Tismer Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
Anyone there to help me out??? -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
Hey Ned, Thanks for reverting. I am looking for the similar functionality. Thanks for sharing that link. Could you pls help me out with the Python Code? Thanks. :) -- https://mail.python.org/mailman/listinfo/python-list
Screenshots in Mac OS X
Hi Guys, Good Morning! How are you all doing? I am in need of your help. I am stuck in a problem. I want to write my own Screenshot Taking program in Python for Mac OS X. Example : Whenever Command + Shift + 3 is pressed ==> whatever is there on the screen, should be grabbed / captured, and should be stored on my local with my own desired path, and name should automatically given as SnapshotX.. as in Snapshot1, Snapshot2, etc... The same goes with Command + Shift + 4 ==> the only difference is that, it allows you to select a particular area to be captured / grabbed. Command + Shift + 5 ==> This one is a little bit tricky which I am looking for. This shortcut doesn't exist. I want to create one of my own, where it would grab the entire webpage's screenshot which I am currently working on, and store the name as the webpage's link. Thanks in advance for your kind help and time. Thanks & Regards, Pratts -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
In article <22861e2f-50f2-4d74-9024-53caec557...@googlegroups.com>, Pratik Mehta wrote: > I want to write my own Screenshot Taking program in Python for Mac OS X. > > Example : Whenever Command + Shift + 3 is pressed ==> whatever is there on > the screen, should be grabbed / captured, and should be stored on my local > with my own desired path, and name should automatically given as SnapshotX.. > as in Snapshot1, Snapshot2, etc... > > The same goes with Command + Shift + 4 ==> the only difference is that, it > allows you to select a particular area to be captured / grabbed. > > Command + Shift + 5 ==> This one is a little bit tricky which I am looking > for. This shortcut doesn't exist. I want to create one of my own, where it > would grab the entire webpage's screenshot which I am currently working on, > and store the name as the webpage's link. I'm not sure how much what you want to do differs from what OS X already provides out of the box but perhaps this reference can give you some ideas: http://guides.macrumors.com/Taking_Screenshots_in_Mac_OS_X -- Ned Deily, n...@acm.org -- https://mail.python.org/mailman/listinfo/python-list
Re: Screenshots in Mac OS X
On Sun, Oct 20, 2013 at 9:12 AM, Pratik Mehta wrote: > Command + Shift + 5 ==> This one is a little bit tricky which I am looking > for. This shortcut doesn't exist. I want to create one of my own, where it > would grab the entire webpage's screenshot which I am currently working on, > and store the name as the webpage's link. Sounds like a difficult thing to write from scratch. Can you find something off-the-shelf that takes a snapshot of your current window, and then maybe add some interaction with the web browser? Otherwise, you're poking around with screenshotting directly, which is very much a solved problem. Also, please read this before you reply: https://wiki.python.org/moin/GoogleGroupsPython ChrisA -- https://mail.python.org/mailman/listinfo/python-list
Screenshots in Mac OS X
Hi Guys, Good Morning! How are you all doing? I am in need of your help. I am stuck in a problem. I want to write my own Screenshot Taking program in Python for Mac OS X. Example : Whenever Command + Shift + 3 is pressed ==> whatever is there on the screen, should be grabbed / captured, and should be stored on my local with my own desired path, and name should automatically given as SnapshotX.. as in Snapshot1, Snapshot2, etc... The same goes with Command + Shift + 4 ==> the only difference is that, it allows you to select a particular area to be captured / grabbed. Command + Shift + 5 ==> This one is a little bit tricky which I am looking for. This shortcut doesn't exist. I want to create one of my own, where it would grab the entire webpage's screenshot which I am currently working on, and store the name as the webpage's link. Thanks in advance for your kind help and time. Thanks & Regards, Pratts -- https://mail.python.org/mailman/listinfo/python-list