Jump to content

C:\ becomes C;\ ?


Garfke
 Share

Recommended Posts

To open a file I paste the path of that file in the "open file dialog" but the path

C:\data\... becomes C;\data\... ?

ControlFocus("Open worksheet","","Edit1");

;Sleep(100);

ControlSend("Open worksheet","","Edit1",$myData,1);

$myData contains the full absolute path to a file.

When I uncomment the sleep the "pasted path" is OK... but this looks like a hack to me.

Is there a better solution then Sleep()?

Link to comment
Share on other sites

To open a file I paste the path of that file in the "open file dialog" but the path

C:\data\... becomes C;\data\... ?

$myData contains the full absolute path to a file.

When I uncomment the sleep the "pasted path" is OK... but this looks like a hack to me.

Is there a better solution then Sleep()?

This happen because you send it to fast and the shift key get lost in the process.

You can fix by setting these settings to a higher delay.

Opt("SendKeyDelay", 5)          ;5 milliseconds
Opt("SendKeyDownDelay", 1)      ;1 millisecond

Another suggestion is that if you don't need to send. Then use

ControlSetText ( "title", "text", controlID, "new text" [, flag] )

This is faster than the other but required more information for it to work.

Edited by WolfWorld
Link to comment
Share on other sites

This happen because you send it to fast and the shift key get lost in the process.

You can fix by setting these settings to a higher delay.

Opt("SendKeyDelay", 5)          ;5 milliseconds
Opt("SendKeyDownDelay", 1)      ;1 millisecond

Another suggestion is that if you don't need to send. Then use

ControlSetText ( "title", "text", controlID, "new text" [, flag] )

This is faster than the other but required more information for it to work.

Tnx for the answer. The first suggestion doesn't work. The ; is still there.
Link to comment
Share on other sites

Using sleep in a way you described in your first post is not a hack at all. It's a very common thing to do, you're simply giving the app some time to fully process the ControlFocus command you've just sent it.

An ideal solution would be to hook into the process you are sending ControlFocus to and know when it's done with the command you sent it. The problem is that there's really no way to determine where the code ends that is being run by app when you send it the command.

Link to comment
Share on other sites

Using sleep in a way you described in your first post is not a hack at all. It's a very common thing to do, you're simply giving the app some time to fully process the ControlFocus command you've just sent it.

An ideal solution would be to hook into the process you are sending ControlFocus to and know when it's done with the command you sent it. The problem is that there's really no way to determine where the code ends that is being run by app when you send it the command.

Ok, I thought there was possibly some "wait" function...

Tnx for the replies.

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