Sign in to follow this  
Followers 0
OiMunk

Trouble with multiple scripts sending to same text field.

3 posts in this topic

I wrote a small script that increments the text in a field. This works perfectly, except that the user tends to trigger the script in quick succession, which creates a jumble of text in the field. I'm not sure how to make one script wait for another, or stop two identical scripts from running.

$var = ControlGetText("REAPER v", "", "[iD:1137]")

ControlFocus("REAPER v", "", "[iD:1137]")

ControlSend("REAPER v", "", "[iD:1137]","{DEL}{DEL}{DEL}{DEL}{DEL}" & $var+$Inc & "{ENTER}")

;The field wouldn't accept Ctrl+A to select the existing text, so I resorted to multiple {DEL}'s to clear the field. There must be a better way.

Any help appreciated,

cheers,

Share this post


Link to post
Share on other sites



OiMunk - You should read in the AutoIt Help file for these two functions:

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

#Include <Misc.au3>
_Singleton($sOccurenceName[, $iFlag = 0])

The second keeps other identical scripts from running. :D


Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

Thanks Squirrely! It works flawlessly now,

cheers

OiMunk - You should read in the AutoIt Help file for these two functions:

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

#Include <Misc.au3>
_Singleton($sOccurenceName[, $iFlag = 0])

The second keeps other identical scripts from running. :D

Share this post


Link to post
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
Sign in to follow this  
Followers 0