Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running a proceseries over a series of variables
#1
Hi,
I know this is basic programming and I have tried to learn from the examples but I know there must be a more elegant way (I probably just need a pointer to right area of QM help manual). This is a simplified version of what I am trying to accomplish:

Code:
Copy      Help
Acc a=acc(seriesname "LISTITEM" win("Cheshire Launch Pad" "CabinetWClass") "SysListView32" "" 0x1001)
int x y cx cy
a.Location(x y cx cy)
mou x+5 y
lef+
mou +5 0
act win("Cheshire(TM)" "CheshireMainFrame")
lef-
0.2

This will set focus on filename in folder, get its location, then drag and drop it over into another applications' (Cheshire) window where it will open properly. (the reason I just can't open that file by name is that it doesn't have extension which means that this will pop up the Windows associate file dialog each time. The reason just can ren* them all is that subsequent modifications have to save back to the original filename)

Anyway,
the series of str variable seriesname that I want to launch looks something like this:




e.g.: (I have just listed the first few for simplicity)

seriesname
"*re*T2*" "*re*air*" "*re*re*ad*" "*re*ost*ad*"

(they are wildcarded because of variability in the filenaming pattern but the Acc flag 1001 should take care of this)


I know I could make the code above into a user-defined function and pass the series name to it repeatedly from a macro using str&seriesname in the receiving function (calling the function for each member of the seriesname group)

But it seems that since nothing else changes this could probably be done all within a macro using an array of some sort (I think this is right).

Any pointers or direction to look into would be great.

Thanks,
Stuart
#2
Code:
Copy      Help
str seriesname=
;*re*T2*
;*re*air*
...
str s
foreach s seriesname
,Acc a=acc(s ...)

---

Does the app not support passing the filename in command line?

run "...xxx.exe" "file"
#3
I didn't know you could try through command line. That's incredibly elegant and reliable:

Unlike my horrible screen GUI-type approach (actually driving a drag-and-drop - UGH!).

Thanks again,

Stuart
#4
I have trying this as test code:



Code:
Copy      Help
str folderpath
BrowseForFolder(folderpath "")

str imagename=
*Blue*
*unset*
*lil*
r.jpg


str imagelauncher
foreach imagelauncher imagename
    str seriescombo.format("%s\%s" folderpath imagelauncher)
    run "$program files$\Internet Explorer\iexplore.exe" seriescombo

in that folder there are four pictures with names

Blue Hills
Water lilies.jpg
Sunset.jpg
Winter.jpg

I want to load each of them successively into internet explorer

The problem is in the syntax in the run line.

How do you specify to open a certain file (regardless of whether it has an appropriate extension or not) into a specific application

e.g.

an image file can come up in many different software apps.

Thanks,
Stuart
#5
See above

That's the way I set it up, don't know if that's the problem also.


Thanks,
Stuart
#6
Are * in these strings wildcard characters? If yes, you need also to enumerate files.


Forum Jump:


Users browsing this thread: 1 Guest(s)