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

Copy 'Get Info' data to the clipboard System
Easily the most annoying bug in Finder.app is the "Get Info" window, which to this day -- inexplicably -- still will not let you select and copy information out of it, such as a path. This issue has become even more annoying since Tiger added the "Where From" field, which is unselectable as well.

You could probably find a third party app to get around this, but I discovered that Apple actually does provide an obscure way to get at this text. GUI scripters might be familiar with Apple's UI Element Inspector, which is a free app you can download here [299KB].

This inspector will give you the nitty gritty details of whatever UI element your cursor is hovering over. Think of it as the ultimate "Get Info," or "Get More Info than I ever wanted to know" application. Once you've downloaded the app, you'll need to launch it and then open the Get Info window for the file you're interested in. Hover your mouse pointer over the relevant text in the Get Info window, and hit Command-F10 on your keyboard. This "locks" the information you found at that position in the UI Element Inspector's main window. Somewhere in all that jargon, you should be able to locate the information you wanted in plain text, and -- conveniently enough -- it can be selected, copied, and pasted wherever you like. To make things even easier, read on for a simple AppleScript to do the work for you...

Here's the AppleScript code:
set AppleScript's text item delimiters to ""
tell application "System Events"
  set theInfo to the value of static texts of scroll area of ¬
   window of process "Finder" as list
  set theCount to the number of items of (item 1 of item 1 of theInfo)
  set theTexts to {}
  repeat with w from theCount to 1 by -1
    set the end of theTexts to value of static text w ¬
     of scroll area of window of process "Finder" as text
  end repeat
  set AppleScript's text item delimiters to return
  set the clipboard to theTexts as string
end tell
[robg adds: I haven't tested the script...]
    •    
  • Currently 2.50 / 5
  You rated: 2 / 5 (4 votes cast)
 
[17,452 views]  

Copy 'Get Info' data to the clipboard | 6 comments | Create New Account
Click here to return to the 'Copy 'Get Info' data to the clipboard' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
GUI scripting not needed...
Authored by: Krioni on Jun 17, '05 03:01:10PM
Remember, whenever you think GUI Scripting is the answer, check to see first if it is unnecessary. First, when I run your script, I get an error. Second, you can get the info about a selected Finder item without using GUI scripting. Try this:


on run
	tell application "Finder"
		set selectedItem to (item 1 of (get selection))
		set infoList to {}
		copy ("Displayed Name: " & displayed name of selectedItem) to end of infoList
		copy ("Kind: " & kind of selectedItem) to end of infoList
		copy ("Size: " & size of selectedItem & " (" & physical size of selectedItem & ")") to end of infoList
		copy ("Where: " & (selectedItem as alias) as string) to end of infoList
		copy ("Created: " & creation date of selectedItem) to end of infoList
		copy ("Modified: " & modification date of selectedItem) to end of infoList
		copy ("Name & Extension: " & name of selectedItem) to end of infoList
		copy ("Locked: " & locked of selectedItem) to end of infoList
		copy ("Comments: " & comment of selectedItem) to end of infoList
		copy ("Owner: " & owner of selectedItem) to end of infoList
		copy ("Group: " & group of selectedItem) to end of infoList		
	end tell
	set {od, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
	set infoAsString to infoList as string
	set AppleScript's text item delimiters to od
	set the clipboard to infoAsString
	return infoAsString
end run

I don't know exactly which things you wanted from the Info window, but this is most of it. Also, you could write a script to clean up the scientific notation for the file size, but I'm not going to spend time on it now. :-) Notice also that if you have more than one item selected, this just gets the info for the first. You could re-write it to loop over multiple items.

[ Reply to This | # ]

Re: GUI scripting not needed...
Authored by: Uncle Asad on Jun 17, '05 05:24:40PM

Very cool...thanks!



[ Reply to This | # ]
GUI scripting not needed...
Authored by: ever on Jun 17, '05 07:03:56PM
That is a good script. This hint is a bit dated, because I was already able to find the stuff I wanted (like spotlight data, which doesn't appear in your script, or Finder's dictionary) by using other methods. It is, however, an interesting exercise in GUI scripting, and it might enlighten a few people who are trying to solve completely different problems.

[ Reply to This | # ]
GUI scripting not needed...
Authored by: adrianm on Jun 18, '05 03:12:28AM

Finder item properties don't have the "Where from", "colour depth", etc (basically, the mds info that Get Info shows).

So, short of extracting via GUI scripting or parsing an mdls call, you're pretty stuck.



[ Reply to This | # ]
Copy 'Get Info' data to the clipboard
Authored by: ever on Jun 17, '05 07:16:02PM
The script mentioned in this hint as written is an interesting example of GUI scripting, but in practice it's not as useful as other methods I've found. In testing this script that I wrote a few weeks ago I've found that it only works when the Get Info window is the *only* window open in the Finder. This is because while I wrote it I was only testing files on my desktop. If there is a demand to fix this bug, I might spend some time on it, otherwise I highly recommend you check out these other hints.

[ Reply to This | # ]
Copy 'Get Info' data to the clipboard
Authored by: runcoberry on Jun 20, '05 07:28:42AM

You can also take a demo of BareBone's rather new app, Super Get Info.

<http://www.barebones.com/products/super/index.shtml>

This allows you to do great stuff with infopages.

---
______________
It's a perfect day for Banafish



[ Reply to This | # ]