Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Many people are not aware that on Windows you can copy the whole text content of a MessageBox by pressing Ctrl ⌃ + C when the dialog is focused.

This is an essential feature for reporting error messages, and in some cases these could be huge.

Still, it seems that on OS X, that Command ⌘ + C does not work and I'm wondering if there is another method for doing this.

Doing screenshots is not so convenient, especially that they are not searchable :p

I am looking for a generic solution, if it exists. Here is an example:

enter image description here

share|improve this question
2  
In some cases you can select the text with you mouse/trackpad and once it's selected you can copy it by Cmd + C ; but, unfortunately, that isn't always possible –  iolsmit May 3 '12 at 22:19
    
It seems that it depends on how the developer implemented the dialog. In Safari, Textmate, and Terminal, the dialogs that I tried were all selectable. I attempted to view the about dialog for Transmit, and its text is not selectable. –  badams May 3 '12 at 22:40
    
Agreed. It all depends on the box. Some text boxes I can select, some I can't. Your best bet is to just take a screenshot of the dialog box. –  daviesgeek May 8 '12 at 20:53

3 Answers 3

up vote 3 down vote accepted

The most generic way may be to use the Accessibility Inspector and copy the text form its window.

In Mac OS X v10.4 and later, Apple provides the Accessibility Inspector testing tool...

Accessibility Inspector presents a utility window that displays the attributes (and values), actions, and position in the accessibility hierarchy of the object currently under the mouse pointer. To use Accessibility Inspector, be sure to enable assistive applications in the Universal Access Preferences.

Accessibility Inspector icon

Here is an example for Trim Enabler, where you can't select and copy the text of the "About" tab:

Trim Enabler - About tab

And the window displayed by Accessibility Inspector:

Accessibility Inspector example

This is with the mouse pointer hovering over the long text, which can then be found in AXValue.

Edit 2014-10-18:

The next example shows step-by-step how to copy text that is not selectable using Accessibility Inspector 4.0:

Open the window from where the information shall be extracted and open Accessibility Inspector, then hover the mouse pointer over the element of interest:

copy_text_with_Accessibility_Inspector

Press Command ⌘ + 7 to lock Accessibility Inspector, then click on the line you want to copy (e.g. AXValue) and press Command ⌘ + C to copy it to the clipboard:

lock_Accessibility_Inspector_and_select_AXValue

Paste the copied text where needed:

pasted text

share|improve this answer
    
I tried to do this using accessibility inspector but unable to get the text. Can you explain the steps? –  Metal Gear 2 days ago
1  
@MetalGear -> I added another example that shows step-by-step how to copy the desired text using Accessibility Inspector 4.0 –  iolsmit 2 days ago

The general case is that the programmer needs to expose this text on a dialog by dialog basis, so you can't easy just copy the text unless the program intends for you to have that function.

The things you could do, but seem more work than it's worth is enable universal access where the text could be sent to an external device such as a braille display or other special purpose device and somehow captured.

You could also try to crack that program and modify the dialog call to change things so that it's always selectable. That might make a better question for the programming side of things.

You've done the practical thing - take a snapshot and hope the message is logged elsewhere to a text file. Linking to this question might be a nice way to ask the developer of programs where you need this ability to modify their coding practice like Safari, Terminal and other programs mentioned in the comments above.

share|improve this answer

You can also run a script like this in AppleScript Editor:

tell application "System Events"
    value of UI elements of windows of process "Application Name"
end tell

If you don't see the text in the results, try to add one or more UI elements of parts after value of.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.