Jump to content

Blockinput is blocking Send{enter}


Go to solution Solved by reb,

Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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 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!

Link to comment
Share on other sites

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.

>>>> 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 by WalkahWalkah
Link to comment
Share on other sites

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."

Link to comment
Share on other sites

  • Moderators

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...