topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 5:20 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Grab contents of an on-screen list  (Read 6760 times)

Jimdoria

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 257
    • View Profile
    • Donate to Member
IDEA: Grab contents of an on-screen list
« on: June 19, 2007, 02:59 PM »
I know this one is pretty simple, but I haven't been able to work it out in AHK myself yet, so I thought I'd post it.

I have several programs that display information in a standard list view, but make it difficult to get at that information in a format I can work with. I'm working with a couple of programs that use a binary format when they save the list data to disk. I can manually go through and scrape the list data out of the binary file, but it's drudgery.

It would be nice to have a tool that would let you click on a visible list view, and would "suck up" the entire list and place it on the clipboard. You could then paste it into a text editor and do whatever was needed to it.

Options might include whether to separate list columns with commas, tabs, or a custom character.
- Jimdoria ~@>@

There are two kinds of people in the world: Those who divide everybody into two kinds of people, and those who don't.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Grab contents of an on-screen list
« Reply #1 on: June 19, 2007, 03:14 PM »
the best program i know to do this is a shareware program called Kleptomania. It's been discussed before on the forum (website: http://www.structurise.com/kleptomania/).

there may be other tools as well that do it.

Boxer Software

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 31
  • Author of the Boxer Text Editor
    • View Profile
    • Boxer Software
    • Read more about this member.
    • Donate to Member
Re: IDEA: Grab contents of an on-screen list
« Reply #2 on: June 19, 2007, 07:05 PM »
SnagIt can do this (and a million other things).  Set the input profile to "Text from Window."  Activate the capture, and click on the listbox of interest.

Jimdoria

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 257
    • View Profile
    • Donate to Member
Re: IDEA: Grab contents of an on-screen list
« Reply #3 on: June 20, 2007, 09:29 AM »
Thanks for the replies, Mouser & Boxer!

Kleptomania uses OCR to recognize the contents of window regions. That really seems like the long way around! It's definitely the most flexible solution, since many programs will use custom text display methods and not necessarily the Windows controls. It would work even with a Flash application, for example.

But for a simple windows app using a simple Windows list box, I'd think simply accessing the list through the Windows API would be much simpler. AutoHotKey has this capability - I've played around with it a bit - I just haven't had time to really dig in and get it working. I'm a very occasional dabbler in AHK, so I just thought that what might take me many hours of dev time to work through would probably be fairly trivial for a wiz like Skrommel.

It's neat that SnagIt can do this, too, but SnagIt is definitely overkill for this one task. Plus it's $$$. Hmmm... maybe this could be a future enhancement to Screenshot Captor? ;)
- Jimdoria ~@>@

There are two kinds of people in the world: Those who divide everybody into two kinds of people, and those who don't.

JoTo

  • Super Honorary
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 236
    • View Profile
    • Donate to Member
Re: IDEA: Grab contents of an on-screen list
« Reply #4 on: June 20, 2007, 09:58 AM »
Hi Jimdoria,

i stumbled upon a nice freeware tool here on DC Forum that does exactly what you need, "SysExporter".

No need to install (portable). Start it and it searches all open windows and all controls in this window, presenting a list of open Windows with all its controls in the upper pane. Click on a child control in the pane and see the contents of the control in the lower pane.

Then select your columns you want to have exported and or the items you want to have exported (or say all columns and/or all items) and choose how you will get them. There are:

- Copy selected items to Clipboard Tab-limited
- Copy selected items to Clipboard Regular
- HTML-Report (All or only selected items)
- Export (All or only selected items) as a Textfile or Tab-delimited Textfile or Tabular Textfile or HTML-File horizontal or HTML-File vertical or XML-File.

I think there is sth. for everyone to work on with the data in other programs, eh?  ;D

That works all with controls that aren't selectable (marking with mouse) too and for dialogboxes that content can't be copied (good for long system error dialog messages e.g.)

I love this little tool and it was a timesaver for me more than once. And as i mentioned earlier, you can't beat the price - its totally free (Freeware)!

Ah, forgot, go get it here:
http://www.nirsoft.net/utils/sysexp.html

There are other nice utils there too. And thanks that you forced me, while writing this post, to visit its homepage. So i noticed that there is a new version 1.21 out.  ;D

HTH
JoTo

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Grab contents of an on-screen list
« Reply #5 on: June 20, 2007, 02:34 PM »
 :) Try this script!

Save it as CopyListView.ahk, and download and install AutoHotkey.

Skrommel

;CopyListView.ahk
; Press F1 over a listview to copy the contents to the clipboard
;Skrommel @ 2007

#SingleInstance,Force
#NoEnv
AutoTrim,Off

columnseparator=%A_Tab%   ; replace with your own separator  tab     = %A_Tab%
rowseparator=`n           ; replace with your own separator  newline = `n

F1::
MouseGetPos,mx,my,mwin,mctrl
ControlGet,list,List,,%mctrl%,ahk_id %mwin%
If columnseparator<>%A_Tab%
  StringReplace,list,list,%A_Tab%,%columnseparator%,All
If rowseparator<>`n
  StringReplace,list,list,`n,%rowseparator%,All
clipboard:=list
TrayTip,CopyListView,%list%
Return

Jimdoria

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 257
    • View Profile
    • Donate to Member
Re: IDEA: Grab contents of an on-screen list
« Reply #6 on: June 20, 2007, 03:27 PM »
Thank you both JoTo and Skrommel!

I'll use the AHK script first, then check out SysExporter when I have some time. Sounds like a good one to keep in the toolkit.

I appreciate the script because I am trying to learn AHK and it helps to see how the "pros" do it!  :Thmbsup:
- Jimdoria ~@>@

There are two kinds of people in the world: Those who divide everybody into two kinds of people, and those who don't.