Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
the 'act' command
#1
Hello,  I've been away from my computer for about a year because of illness. Now I am back and my W-10 (64) system has all of the updates. BUT I have an issue with my macros = they all are failing and the error relates to:

act child(F"{fileName}")

Is there something that has happened w. Win-10 in the past year that relates to this command? The macros ran with virtual perfection before.

I have more than 100 macros that use this and non will run.

Just wondering

Thanks!
#2
what is the value of fileName ?
#3
What is the error?

What is your Windows 10 version? I tested now on my Windows 10 1803 build 17134.165, no errors.

Maybe the target app is running as administrator. Then QM must run as administrator or uiAccess. Look in Options.
#4
ANSWER IN ORDER:

Kevin: this is simply the name of a file that is created by QM via a combination of date + time. Have use this for years w. no problems.

Gintaras:

Windows 10 Pro w. all updates

The target application (Nota Bene) is precisely the same version I was using before my illness w. no updates or changes
QM already runs as 'Admin' but I did test the uiAccess = same result.

As state earlier, I find this a little puzzling in that as far as I know the ONLY changes are w. Windows 10 updates.

I'll keep experimenting.

Thanks!
#5
What is the error message?

int c=child(fileName)
outw c ;;and what this says?
act c
#6
Error message:

Error (RT) in <open "Qwk-Cite /29479">Qwk-Cite: cannot set focus. <help #IDP_ERR>?

PLUS: what does this mean? is this a suggestion?

int c=child(fileName)
outw c ;;and what this says?
act c
#7
Quote:PLUS: what does this mean? is this a suggestion?
No, ignore it.

Macro Macro8
Code:
Copy      Help
int w=win("Font" "#32770")
int c=id(1 w) ;;push button 'OK'

out

if(c=0) end "control not found"
act w
int t1(GetCurrentThreadId) t2(GetWindowThreadProcessId(c 0))
if(!AttachThreadInput(t1 t2 1)) end "AttachThreadInput failed." 16
int prevFocus=SetFocus(c)
AttachThreadInput(t1 t2 0)
out "previous focus:"
outw prevFocus
This macro activates a Font dialog and sets focus to its OK button. It is how act works. Does it fail? What error it shows? If does not fail, how it works when you replace the first 2 lines with a code that finds the Nota Bene window and control?
#8
@ kentatkoylia i would still like to see the code when your formatting  string fileName before you use it in the act child(F"{fileName}") statement.
Also on your old computer what was qm version?
from some test i have done the only way i can make this 

Code:
Copy      Help
act child(F"{fileName}")
 work is by first activating the parent window 

here is my test function to show my results( tested on win7 & win10) same results with current qm version
Function act_child_F_test
Code:
Copy      Help
out
str cn="SysTreeView32"
str pn="Quick Macros"
str chn="Running items"
ArrangeWindows(0)
1
str fileName=F"{chn} {cn} {pn}"
out "starting test 1"
act child(F"{fileName}");;this fails everytime
err
,out "error test 1"
,out _error.description
,1
,out "starting test 2a"
,fileName=F"{chn}"
,act child(F"{fileName}");;this fails unless parent window is active
,err
,,out "error test 2a"
,,out _error.description
,,out "starting test 2b after activating parent window first"
,,act _hwndqm
,,1
,,act child(F"{fileName}");; now this works
,,err
,,,out "error test 2b"
,,,out _error.description
1
ArrangeWindows(0)
1
out "starting test 3"
act child(F"{chn}" F"{cn}" F"{pn}");;this works always
err
,out "error test 3"
,out _error.description
ArrangeWindows(0)
1
out "starting test 4"
act child(F"{chn}" "SysTreeView32" "Quick Macros");;works always
err
,out F"error test 4"
,out _error.description
ArrangeWindows(0)
1
out "starting test 5"
act F"{chn}";;of course doesnt work cause window name is wrong
err
,out F"error test 5 {chn}"
,out _error.description
1
act F"{pn}" ;; works cause window name is correct

@ Gintaras is there a difference in how child works in current qm version compared to  other qm versions? My thought is maybe he was using an older qm version that his code would work on but now that he is on a different version it doesn't . Idk its just a thought.
#9
Quote:is there a difference in how child works in current qm version compared to  other qm versions?


No difference.
#10
ok thanks 
from my test function you can see that i could only get act child(F"{fileName}") to work by activating the parent window

str fileName=F"{chn} {cn} {pn}"
this doesn't work . is there a way to format fileName so it works in act child(F"{fileName}")
could figure it out. had to do either
act child(F"{chn}" F"{cn}" F"{pn}")
or
fileName=F"{chn}"
act child(F"{fileName}" "SysTreeView32" "Quick Macros")
or
activate parent window 
fileName=F"{chn}"
act child(F"{fileName}")
then would work
#11
child(fileName) finds a child window in the active top-level window.
child(fileName "classname" w) finds a child window in window w. If w is inactive, act child(fileName "classname" w) activates w.


Forum Jump:


Users browsing this thread: 1 Guest(s)