Copying Data From an Application Into Macro Scheduler

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Dave E.

Copying Data From an Application Into Macro Scheduler

Post by Dave E. » Tue Jul 13, 2004 11:52 pm

I am trying to copy data from an application window into MS. The data I wish to get is in a table. Using the mouse, I can only select a row in the table. Copying the row of data to the clipboard then pasting the data to Notepad does not work. The pasted data is just old data in the clipboard.

Using View System Windows, it shows the main window of the application and I assume 3 child windows under the main window. One of those child windows class name is SysListView32 and its title is List1. Googling, I found out that this is a List View Control in Report View. The command GetWindowText> using either the main window title or the child window title does not copy the data.

Is there a way I can copy the data from this List View Control?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jul 14, 2004 1:39 am

Re copying into Macro Scheculer...what will you do with it when it is copied? Macro Scheduler does not hold data. It only creates and uses temporary variables passing data back and forth among other programs. No data is available when script is completed except information written to other files.

That being said, perhaps the following may generate some ideas:
===============================
Any way you can "export" the table to a file? If Yes, then you can read the file into Macro Scheduler with ReadLn..

It does not sound like a web page, but, if this is a table on a web page, then you could open the Source Code and copy to clipboard from there? (Actually if a web page table, no reason you shouldn't be able to copy directly to clipboard).

Or you could save the page as a file and use ReadLn to get it into Macro Scheduler.

What is the application name?
Is there a link where this can be seen by one of us?
If Yes, also provide info about what data you are trying to copy.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Dave E.

Re: Bob's Questions

Post by Dave E. » Wed Jul 14, 2004 4:38 pm

Thanks for your comment. Per your questions.

I hope to assign the data to variables in MS.

Unfortunately, there is no way to export the data from the application to a file.

The window is not a web page. It is a custom written application. I do not have access to the application source code.

Unfortunately, it is an application that runs behind a firewall.

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jul 14, 2004 6:54 pm

Just looking for some more hints to help out......

A basic problem seems to be that you cannot copy from that screen into the clipboard, is that correct?

You said it did not paste into Notepad, have you tried to paste into any other programs? Unicode can sometimes be an issue. Have you tried to paste into Wordpad?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Wed Jul 14, 2004 10:26 pm

Loop
ln ++
{
ControlFocus, SysListView32 , List1
Control, Choose, %ln%, SysListView32 , List1
ControlGetText, OutputVar, SysListView32 , List1
If Errorlevel = 0
Break
MsgBox, %OutputVar%
FileAppend, %OutputVar%`n, C:\MyListContent.txt
}

-----
ControlFocus [, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
Sets input focus to a given control on a window
-----
Control, Cmd [, Value, Control, WinTitle, WinText, ExcludeTitle, ExcludeText]
Makes a variety of changes to a control. e.g.
Choose, N: Sets the selection in a ListBox or ComboBox to be the Nth entry. N should be 1 for the first entry, 2 for the second, etc.
-----
ControlGetText
Retrieves text from a control.
-----

Maybe someone can advise how to accomplish that with Macro Scheduler (and/or VBS) - if not you can Google for ControlSend (in one word!)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jul 14, 2004 10:42 pm

Lumumba..........Shades of AutoHotKey?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Lumumba

Post by Lumumba » Wed Jul 14, 2004 10:52 pm

If you've to eat a soup - and a fork won't realy make you happy - recommending a spoon seems to be fair enough 8)

Dave E.

AutoHotkey Looks Interesting

Post by Dave E. » Thu Jul 15, 2004 11:10 pm

Open Source does it again. I am going to have to check AutoHotkey out. Although, I have been very happy with MS.

Thanks Lumumba

Lumumba

Post by Lumumba » Fri Jul 16, 2004 6:58 am

As both scripting tools (MSched + AHK) offers a compiler you can mix the best of both worlds ... e.g. something like this:
MyMainMSchedScript.scp

Input>Name,Please enter your name ...
Run Program>CMD /C MyCompiledAHKCatchAControlScript.exe %Name%
WaitWindowOpen, NotePadInspector
Execute>d:\mypic.bmp

-----

MyCompiledAHKCatchAControlScript.exe
Name = %1%
Status = unsuccessfull
Loop
{
ControlGetText, OutputVar, Edit1, Untitled -
If OutputVar = %Name%
{
ControlSetText, Edit1, Gotcha `!, Untitled -
RunWait, MyMSchedScreenCapture.exe
Status = successfull
Break
}
}
MsgBox, 0, NotePadInspector, Done %Status%., 10

-----

MyCompiledMSchedScreenCapture.exe
GetActiveWindow>window_title,X,Y
ScreenCapture>%X%,%Y%,200,200,d:\mypic.bmp
Just a quick sample right out of my head. :roll: :wink:

The standard:
CMD = WinNT/W2K/XP
Command = W9x/ME

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts