Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QM for automating sequential parametric calculations
#1
Hi!

I hope there is someone who can help...

I am using a windows app that carries out energy calculations (Be10.exe) based on data in an xml-file. I am using windows XP. I have about 1000 xml files generated parametrically. I want to carry out sequential calaculations, one at a time, by reading in the xml-files into the app and then generating (by pressing on 2 buttons) two extra xml-files which contain the results of the calculation. The two generated files are automatically saved into the same folder as the parent xml-file.

The sequence is:

1 Look in file to see how many parent xml-files.
2 Open first file xl-file in Be10.exe.
3 Generate the two result xml-files.
4 Shut the open xml-files.
5 Move onto the next parent xml-file and start at number 1 again.
6 Continue until all parent files are calculated.

I just cannot see how to produce this macro - can anybody help?!
#2
Macro Macro50
Code:
Copy      Help
int interactive=1 ;;replace 1 to 0 if don't need a message box

ARRAY(str) a
GetFilesInFolder a "c:\folder with xml files" "*.xml" 4
if(a.len=0) end "No files found. Try to change GetFilesInFolder arguments."
int i
for i 0 a.len ;;repeat for each xml file
,str& sPath=a[i] ;;sPath variable contains full path of current xml file
,out sPath ;;remove this if don't need to see file paths in QM output
,
,if interactive
,,sel mes(sPath "Process this file?" "YNC")
,,,case 'N' continue ;;No - skip this file
,,,case 'C' break ;;Cancel - stop macro
,
,;Here add code that opens the file (sPath), presses buttons etc.
,;All lines must begin with tab, or will not be repeated.
,
#3
That was great! It works perfectly. Thanks!

But now I cannot get it to play together with the code to click buttons, etc. I have used the following:

,run sPath
,act win(322,15)
,lef 322 15 1 1;;tool bar, push button 'Rapport med nøgletal'

Basically the commands 'act win' and 'lef' do not have any effect. I can see I get the error message "Error (RT) in Macro: window not found."

Any ideas?!
#4
run sPath opens the file in existing window of the application? Then probably window name contains file name?
After this line add 'wait for window active' command. Let the macro wait for window that contains the filename.
Remove the act line, and change the lef line to click in window coordinates, not in screen coordinates.


Forum Jump:


Users browsing this thread: 1 Guest(s)