Jump to content

Recommended Posts

Posted

I'm getting a syntax error on the Msgbox line.

#include <Array.au3>

    $aWinList = WinList("[CLASS:#32770; TITLE:WordPerfect Office X6", "")
    MsgBox(64, "$aWinList", _ArrayDisplay($aWinList, "Win List")

 

Could I please get some help in resolving the syntax error?

Thank you,

Docfxit

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

I believe you need to close the brackets.  You have a left-bracket before CLASS, and no end bracket (likely one is needed after X6).

Hope that helps...this is my first post here.  :bye:

Posted

I'm trying to figure out why I'm not getting anything in the array in this code:

#include <Array.au3>



    $aWinList = WinList("[CLASS:#32770; TITLE:WordPerfect Office X6", "")

    MsgBox(64, "$aWinList", _ArrayDisplay($aWinList, "Win List"))

post-6489-0-12224700-1370885167_thumb.jp

post-6489-0-79000400-1370885287_thumb.jp

Nothing shows up in the array even though the window is active.

Thanks,

Docfxit

Posted (edited)

So the code I posted is working for you now?

The code you posted in >post #4 still didn't have the end bracket, which will not pop a syntax error since it's a valid string as a parameter.

I'm guessing the syntax error you corrected was adding a closing parentheses to the message box.  I'm talking about the missing bracket that I added in for you here:

$aWinList = WinList("[CLASS:#32770; TITLE:WordPerfect Office X6]", "")

Edited by danwilli
Posted

I'm getting an error 7 = No Match on _IEAttach

#include <Array.au3>



$aWinList = WinList("[CLASS:#32770; TITLE:WordPerfect Office X6]", "")

For $n = 1 To $aWinList[0][0]

    MsgBox(64, "$aWinList", _ArrayDisplay($aWinList, "Win List") & @CRLF & "-" & $n & "-")



    ; Test for Instance IE

    $oIE = _IEAttach("[$aWinList[$n][1]; INSTANCE:1]")

    MsgBox(64, "$oIE", $oIE & @CRLF & "-" & @error & "-")



Next

post-6489-0-08237800-1370888726_thumb.jp

I don't understan why I wouldn't be getting error 0 = No Error.

Thanks,

Docfxit

Posted

_IEAttach("[$aWinList[$n][1]; INSTANCE:1]")

This is a string. You need to use this instead.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]")

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

This is a string. You need to use this instead.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]")

/facepalm

Haha, I totally focused on the wrong spot, jumping straight to "Embedded" and posting the same mistake back to the OP.  Thanks BrewMan

Posted

 

Try defining the $s_mode parameter as "Embedded":

$oIE = _IEAttach("[$aWinList[$n][1]; INSTANCE:1]", "Embedded")

I'm still getting error 7 = No Match on _IEAttach

Posted

This is a string. You need to use this instead.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]")

I'm still getting error 7 = No Match on _IEAttach

Posted

It's possible that I solved one problem and BrewMan solved another.

Try combining them.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]", "Embedded")

Let us know how it goes.

Posted

Try it without using the instance parameter, also it might not be considered an Internet Explorer browser which is why it won't find it.

One other thing, what does $aWinList[$n][1] contain? Is there a valid handle in that element?

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

It's possible that I solved one problem and BrewMan solved another.

Try combining them.

_IEAttach("[" & $aWinList[$n][1] & "; INSTANCE:1]", "Embedded")

Let us know how it goes.

Thanks for taking a stab at it.

I'm still getting error 7 = No Match on _IEAttach

Posted (edited)

Try it without using the instance parameter, also it might not be considered an Internet Explorer browser which is why it won't find it.

One other thing, what does $aWinList[$n][1] contain? Is there a valid handle in that element?

Thanks for the suggestion.

I tried:

$oIE = _IEAttach("[" & $aWinList[$n][1] & "]")

I'm still getting error 7 = No Match on _IEAttach

$aWinList contains this:

post-6489-0-69536600-1370894916_thumb.jp

$n contains 1

Thank you very much for the help.

Docfxit

Edited by Docfxit
Posted

Try this, seeing as how you're using a handle instead of a title string.

$oIE = _IEAttach("[" & $aWinList[$n][1] & "]", "HWND")

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Posted

Try this, seeing as how you're using a handle instead of a title string.

 

$oIE = _IEAttach("[" & $aWinList[$n][1] & "]", "HWND")

Thanks for the suggestion.

I'm still getting error 7 = No Match on _IEAttach

If you think I'd be better off using a title I'd be happy to.

What would the string look like?

Thanks,

Docfxit

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...