Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"if w" strange behavior...
#1
Hi!
Strange behavior detected...

This one works:
 
Code:
Copy      Help
if win("Notepad" "Notepad")
,act win("Notepad" "Notepad")
else
,run "$system$\notepad.exe" "" "" "" 0x200
,rep()
,,0.01
,,if win("Notepad" "Notepad")
,,,mov+ 0.5 0 0.5 1.0 win("Notepad" "Notepad") 4
,,,break


But this one doesn't:
 
Code:
Copy      Help
int w = win("Notepad" "Notepad")
if w
,act w
else
,run "$system$\notepad.exe" "" "" "" 0x200
,rep()
,,0.01
,,if w
,,,mov+ 0.5 0 0.5 1.0 w 4
,,,break

But both macros are actually the same... How is that possible?
Actually, if Notepad is already running, the second macro detects it, and activates the window (act w). But the "else" condition is never met...

And another question, is there more elegant way to wait for the window to appear than this rep()... - construction?

Thank you for your help!


Forum Jump:


Users browsing this thread: 2 Guest(s)