WalkahWalkah Posted February 19, 2014 Posted February 19, 2014 Hey I am sure this is a silly problem but for some reason I can't get send to work with anything in the braces. Here is an example of code. I am actually trying to get this to work with sharepoint but I wrote a quick notepad version to make sure it wasn't related to that program. Ideas? blockinput(1) Run("notepad.exe") sleep(3000) Send("j{enter}") blockinput(0) Exit
Moderators JLogan3o13 Posted February 19, 2014 Moderators Posted February 19, 2014 (edited) The help file is your friend. Taken almost word for word from the example for BlockInput. BlockInput(1) Run("Notepad.exe") $hWnd = WinWait("[CLASS:Notepad]", "") ControlSend($hWnd, "", "Edit1", "j{ENTER}") BlockInput(0) Edited February 19, 2014 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
WalkahWalkah Posted February 19, 2014 Author Posted February 19, 2014 (edited) Thanks for your reply. But that doesn't quite answer my question. The help file states that send function should work while blockinput is in effect. It isn't. Do you know if there is a way around that? Like I stated my actual issue is with sharepoint and I am not sure if I just don't understand the control portion enough but I can't figure out a way to have it work with controlsend. Here is the code for it. Blockinput(1) Run(EnvGet("SystemDrive") & "\Program Files (x86)\Microsoft Office\Office14\Groove.exe") sleep(3000) WinActivate("Launchbar - Microsoft SharePoint Workspace") Send("j", "{enter}") sleep(1000) MouseClick("Left",129, 266) sleep(1000) If WinExists("J - AssetList - Microsoft SharePoint Workspace") then WinActivate("J - AssetList - Microsoft SharePoint Workspace") Send("{tab}" & "^f") else blockinput(0) msgbox(0,"","AssetListFail") exit endif endif Blockinput(0) The reason for j{enter} is the file I am trying to get autoit to open starts with a J. Here is the window info from it if you can show me how to do it with control send. expandcollapse popup>>>> Window <<<< Title: Launchbar - Microsoft SharePoint Workspace Class: Groove.Window.Class Position: 400, 159 Size: 800, 632 Style: 0x96CF0000 ExStyle: 0x00040100 Handle: 0x00190CF2 >>>> Control <<<< Class: Groove.MultiselectTreeView.Class Instance: 2 ClassnameNN: Groove.MultiselectTreeView.Class2 Name: Advanced (Class): [CLASS:Groove.MultiselectTreeView.Class; INSTANCE:2] ID: 1 Text: Position: 9, 150 Size: 766, 395 ControlClick Coords: 257, 67 Style: 0x5401D0A9 ExStyle: 0x00000000 Handle: 0x000C1284 >>>> Mouse <<<< Position: 674, 376 Cursor ID: 0 Color: 0xFBFCFC >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< MsoDockTop Ribbon Ribbon MsoDockBottom Status Bar Status Bar Workspaces >>>> Hidden Text <<<< MsoDockLeft MsoDockRight Contacts MsoWorkPane Edited February 19, 2014 by WalkahWalkah
WalkahWalkah Posted February 19, 2014 Author Posted February 19, 2014 Here is the help file stating you can use send while blockinput is on, yet send is broke when you try to do specific things inside braces. Is there any way to use send for enter or tab while blockinput is on or should the help file be edited to reflect the limitations of send while blockinput is turned on? https://www.autoitscript.com/autoit3/docs/functions/BlockInput.htm "BlockInput() only affects user-input. Input from functions like Send() or MouseMove() still work."
AdamUL Posted February 20, 2014 Posted February 20, 2014 (edited) Send("j", "{enter}") You have a syntax error, try this. Send("j{enter}") The second argument for Send is for a flag. Adam Edited February 20, 2014 by AdamUL
Moderators JLogan3o13 Posted February 20, 2014 Moderators Posted February 20, 2014 I see the OP typed it incorrectly in a subsequent post, but if you look at post #1 you'll see he had the syntax correct and was still reporting failure. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
Solution reb Posted February 20, 2014 Solution Posted February 20, 2014 Posted code in post 1 works for me win7 64 autoIt 3.3.8.1 REB MEASURE TWICE - CUT ONCE
AdamUL Posted February 20, 2014 Posted February 20, 2014 Then the question becomes, which code is he using. The OP uses notepad, but the one with syntax error uses Groove. Maybe he needs to breakup the Send command, as the program my reacting the "j", but missing the "{enter}". Something like this maybe. Send("j") Sleep(250) Send("{enter}") Adam
WalkahWalkah Posted February 20, 2014 Author Posted February 20, 2014 Posted code in post 1 works for me win7 64 autoIt 3.3.8.1 REB Thank you for confirming it worked. After you came back with a positive I tried re-installing to make sure it wasn't a version issue, Tried 3.3.10.0 3.3.10.2 and 3.3.8.1 without luck. Kept digging turns out it was caused by another program called "Phrase Express" that was blocking {tab} and {enter} to work while blockinput() was enabled. Thanks to everyone who helped.
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