Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Take screenshots in screenshot-unfriendly apps Apps

There are some apps out there that simply refuse to allow you to take a screenshot of them -- this is usually limited to games which hijack the keyboard so that they intercept your screenshot command before Mac OS X itself can notice it, and perhaps Classic applications. But, I figured out a way to get a screenshot anyway.

The secret is Grab (in Applications -> Utilities), the much-maligned application that's pretty much useless for taking screenshots since you might as well use the regular key combos. Grab's one redeeming feature, though, is its great "Timed Screenshot" feature, which allows you to get your screen all set up perfectly within 10 seconds before it takes the capture. Unfortunately, you can't change that interval, so you still may not be able to set up the screen fast enough for Grab to work.

But AppleScript comes to the rescue! Although Grab itself is not scriptable, you can use UI Scripting to control it, and this allows us to lengthen this interval. First, we need to activate GUI scripting. Under Panther, go to System Preferences -> Universal Access, and check "Enable access for assistive devices". For Jaguar, you must enable this as well, but you must also first download a GUI scripting package from Apple (which doesn't seem to be hosted on their site anymore -- anyone got a link?).

Now, open up Script Editor, paste in the following code, and save it as a script applet (an app that you can double click which will execute the code):


tell application "Grab"
  activate
end tell
tell application "System Events"
  tell application process "Grab"
    click menu item "Timed Screen" of menu 
    "Capture" of menu bar item "Capture" of menu bar 1
    activate
    delay 50
    click button "Start Timer" of window "Timed Screen Grab"
  end tell
end tell

This script is a 60 second time-delay screenshot. It delays for 50 seconds, then starts the Grab timer, which is 10 seconds. Of course, just change the number in the "delay 50" line for whatever you want -- the effective time interval is always that number plus 10 seconds. Now run the script, and then set up your screen in however long you need -- no more rushing to get that screenshot to work!

An interesting side effect of this in some apps is that it allows you to get out of the app even if it hijacks the screen and doesn't allow you to switch to other apps without quitting. Since Grab automatically opens up your timed screenshot once it's taken it, sometimes it forces your application to go in the background, which could be a plus in some circumstances.

    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[16,444 views]  

Take screenshots in screenshot-unfriendly apps | 12 comments | Create New Account
Click here to return to the 'Take screenshots in screenshot-unfriendly apps' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Take screenshots in screenshot-unfriendly apps
Authored by: TimBonnici on Jan 16, '04 01:03:56PM

GUI Scripting for Jaguar can be found at:

http://www.apple.com/applescript/GUI/UIscriptingbeta.sit

kudos to "paulrob" for digging up the URL for a previous hint.



[ Reply to This | # ]
Take screenshots in screenshot-unfriendly apps
Authored by: rexroof on Jan 16, '04 04:43:22PM
you can also simply do this from the terminal like so:
[mogu:~] rex% sleep 5 ; screencapture ~/Desktop/capture.pdf
or you can use the -c option to capture right to the clipboard. sadly, the only file format screencapture outputs is pdf.

[ Reply to This | # ]
Take screenshots in screenshot-unfriendly apps
Authored by: webbix on Jan 17, '04 10:50:56PM
I made a simple script to take screenshots a couple of years back, maybe when in 10.1? Anyway, I added some explanation as I uploaded for the mac user group. It would be simple to add a variable time per use. Here are the controls for 'screencapture': usage: screencapture [-icmwsWx] [file] -i capture screen interactively, by selection or window control key - causes screen shot to go to clipboard space key - toggle between mouse selection and window selection modes escape key - cancels interactive screen shot -c force screen capture to go to the clipboard -m only capture the main monitor, undefined if -i is set -w only allow window selection mode -s only allow mouse selection mode -W start interaction in window selection mode -x do not play sounds -S in window capture mode, capture the screen not the window file where to save the screen capture This is my original script:

display dialog "Capture screen or only an icon.
The highlight area shows capture.
Use 'shift' for crosshair capture.
Capture is on clipboard for paste.
ESC ends. " buttons {"OK"} default button 1
do shell script "screencapture -i -c -W"
I only tinker with Applescript but it should be easy to use a dialog to get your value and pass it to the sleep delay before running.
display dialog ("Delay (in seconds)?") default answer "20"
	copy value to WaitTime
Probably more trouble than it is worth with the other solutions. However maybe useful is you connect remote with ssh and need to get a screen shot then bring it over with rcp.

[ Reply to This | # ]
Take screenshots in screenshot-unfriendly apps
Authored by: DizzyPenguin on Jan 16, '04 06:00:28PM
There was a previous hint here about a script that takes screenshots at timed intervals.

---
DizzyPenguin

[ Reply to This | # ]

Take screenshots in screenshot-unfriendly apps
Authored by: fritz102 on Jan 17, '04 12:37:29AM

Or you could use FreeSnap, which does much more for free, including a customizable timer, dozens of formats, invisible mode, hot keys, menu extra, AppleScriptability, scaling, and more.



[ Reply to This | # ]
SnapNDrag
Authored by: Felix on Jan 17, '04 10:13:39AM

The freeware SnapNDrag also has a "timed shot" feature. A very useful little app I keep in my Dock.



[ Reply to This | # ]
Constrictor
Authored by: osxpounder on Jun 09, '04 12:52:13PM

My favorite screen snap utility is Constrictor, which lets you drag a frame, as well as set up preset frame sizes -- plus lots of other features. It doesn't lack a feature I need; it seems to cover all the bases. Of course, I still don't need it often, because OSX's built-in screen snapping is so great!

---
--
osxpounder



[ Reply to This | # ]
Take screenshots in screenshot-unfriendly apps
Authored by: osxpounder on Jun 09, '04 12:54:30PM

Sadly, I can seldom get Grab via the Services menu. It seems to always be grayed-out whenever I try it -- its menu, I mean. In Safari, even in Finder, I get no love from Grab. Is this true for everyone else? It seems completely illogical, so I am suspicious that something might be wrong with my setup.

---
--
osxpounder



[ Reply to This | # ]
Take screenshots in screenshot-unfriendly apps
Authored by: Alidoro on Jun 09, '04 10:23:18PM

No, t Grab Services don't work here either...



[ Reply to This | # ]
Grab services
Authored by: sjk on Jun 09, '04 11:39:28PM

I've never seen 'em active.



[ Reply to This | # ]
Take screenshots in screenshot-unfriendly apps
Authored by: truhe on Jun 11, '04 08:48:26AM

grab in the services menu is meant to grab the current application window and insert it into the current application. therefore this only works in applications which can handle images. it should work in mail and it should work in textedit, when you edit a rtf file.



[ Reply to This | # ]
Grab services
Authored by: sjk on Jun 14, '04 02:50:11PM

By golly, there they are in TextEdit.



[ Reply to This | # ]