I need an automated screencapture of menus and dialogs

Okay, I am very familiar with shift+command+4 and usrbinscreencapture but the latter seems to require some interaction when used via applescript and therein lies the problem.

For instance, I want to open an application, choose the file menu and perform a shift+command+4+space+click on the menu. This captures only the open menu to file. I need to do this repeatedly to many menus and dialogs.

When I use do shell script…screencapture I can get it to either capture the whole screen or wait for user interaction.

Is there a way to run the shell script then append a space key and a mouse click to the end of the line? or perhaps someone knows another way to do this (besides Eggplant)?

I’ve also tried the screen capture utilities (Snapz & Grab) with no luck. :frowning:

Hi,

I don’t think you can do this in an open application, but you might try looking for the nib file I think it’s called. Open it in Interface Builder and from there you can take a snapshot of the menu. Or, you can just make your own menu in Interface Builder and capture the menu there.

gl,

thanks for the advice but I don’t think that’ll work for this program. we need to see all menus and dialogs of the installed product.

Maybe try Snapz Pro from www.ambrosiasw.com .

I’ve tried Snapz Pro…it still requires user interaction as far as I can tell, even when using “capture” in applescript.

A quick and dirty hack, that polls on cmd and/or alt key down.
Hopes this helps, but needs Extra Suites

delay 2
repeat
delay 1
my exit_on_cmd_down()
end repeat

on exit_on_cmd_down()
tell application “Extra Suites”
if ES command down then – press cmd to screenshot
if ES option down then --or press cmd+alt to end captureapplet
ES multibeep 2 beeping fast
error number 42 --just to produce an error
else
ES multibeep 1 beeping fast
do shell script “screencapture -m -x /Users/Shared/macro/pics/date "+mytest_%y%d%m-%H%M%S.jpg" >/dev/null 2>&1 &”
ES pause 20
end if
end if
end tell
end exit_on_cmd_down

ops sry I missunderstood your question a bit… this script is pretty useless then :-/