Docfxit Posted June 10, 2013 Share Posted June 10, 2013 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 Link to comment Share on other sites More sharing options...
Mizerak Posted June 10, 2013 Share Posted June 10, 2013 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. Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 You are correct. Thanks for the help. Docfxit Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 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")) Nothing shows up in the array even though the window is active. Thanks, Docfxit Link to comment Share on other sites More sharing options...
DW1 Posted June 10, 2013 Share Posted June 10, 2013 As Mizerak pointed out, you're still missing the ending bracket. #include <Array.au3> $aWinList = WinList("[CLASS:#32770; TITLE:WordPerfect Office X6]", "") MsgBox(64, "$aWinList", _ArrayDisplay($aWinList, "Win List")) AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 I added the end bracket. I'm not getting a syntax error any more. Thanks, Docfxit Link to comment Share on other sites More sharing options...
DW1 Posted June 10, 2013 Share Posted June 10, 2013 (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 June 10, 2013 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 That's super. Thank you very much. That fixed it. I didn't see the change you made the first time. Thanks, Docfxit Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 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 I don't understan why I wouldn't be getting error 0 = No Error. Thanks, Docfxit Link to comment Share on other sites More sharing options...
DW1 Posted June 10, 2013 Share Posted June 10, 2013 Try defining the $s_mode parameter as "Embedded":$oIE = _IEAttach("[$aWinList[$n][1]; INSTANCE:1]", "Embedded") AutoIt3 Online Help Link to comment Share on other sites More sharing options...
BrewManNH Posted June 10, 2013 Share Posted June 10, 2013 _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 GudeHow 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 Link to comment Share on other sites More sharing options...
DW1 Posted June 10, 2013 Share Posted June 10, 2013 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 AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 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 Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 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 Link to comment Share on other sites More sharing options...
DW1 Posted June 10, 2013 Share Posted June 10, 2013 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. AutoIt3 Online Help Link to comment Share on other sites More sharing options...
BrewManNH Posted June 10, 2013 Share Posted June 10, 2013 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 GudeHow 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 Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 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 Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 (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: $n contains 1 Thank you very much for the help. Docfxit Edited June 10, 2013 by Docfxit Link to comment Share on other sites More sharing options...
BrewManNH Posted June 10, 2013 Share Posted June 10, 2013 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 GudeHow 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 Link to comment Share on other sites More sharing options...
Docfxit Posted June 10, 2013 Author Share Posted June 10, 2013 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now