AutoHotkey Community

It is currently May 27th, 2012, 1:24 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: June 23rd, 2005, 11:09 am 
Offline

Joined: June 16th, 2005, 12:23 pm
Posts: 92
The following extensions to the Send command would be helpful, I think.

1) "Send blabla{wait n}more blabla" where {wait n} waits for n milliseconds

2) "Send blabla{setkeydelay n}more blabla" where {setkeydelay n} sets a temporary delay of n

Background: I have several long Send strings that simply don't work correctly with a delay of 0 or 10. OTOH I do not want to send other long Send strings that are perfectly fine with a delay of 0 in the excruciatingly slow 20 or 50 mode.

Thomas


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 23rd, 2005, 11:26 am 
A wishlist topic. :wink:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 23rd, 2005, 11:49 am 
Offline

Joined: June 16th, 2005, 12:23 pm
Posts: 92
BoBo wrote:
A wishlist topic. :wink:


Probably. But I am new to AHK so it's quite possible that I overlooked the obvious solution: the post is a wishlist item and a question at the same time.

I take it that there is no such feature in AHK as it is right now?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 24th, 2005, 4:29 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
There is no such feature yet, but it seems like a good suggestion. However, I wonder if it's worth it because {wait n} doesn't really save much typing. It would be nearly as easy to provide your own Sleep:
Send Text
Sleep 50
Send More text

As for having SetKeyDelay supported directly inside the Send command, it seems a little awkward in syntax, while not saving that much typing either. Also, you might not know that each thread retains its own value of SetKeyDelay. This means that a given hotkey can do SetKeyDelay 10 without fear of affecting the rest of the script; that is, it does not need to restore the original setting prior to returning.

Further comments are welcome.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 24th, 2005, 10:46 am 
Offline

Joined: June 16th, 2005, 12:23 pm
Posts: 92
Chris wrote:
However, I wonder if it's worth it because {wait n} doesn't really save much typing.

Saving a few keystrokes is not at all the point here.

The point is that a Send string with embedded {wait} or {setkeydelay} commands is a sweet one-liner and as such is something I can use inside my filemenu script, whereas your or any other code snippet isn't and can't.

Never mind, I will at some point have a look at the C++ source myself. If I can read it :wink: and if I can figure out a way to put in stuff of my own without too much trouble (Diff is my friend) I may just add that feature on my own.

Thomas


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 25th, 2005, 2:42 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
thomasl wrote:
The point is that a Send string with embedded {wait} or {setkeydelay} commands is a sweet one-liner and as such is something I can use inside my filemenu script, whereas your or any other code snippet isn't and can't.
I haven't been paying attention well enough to understand why a multi-line snippet can't be used in place of a single-line one. It's probably because of the novelty of your script's configuration file. If so, that helps clarify it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 28th, 2005, 1:48 pm 
Offline

Joined: June 16th, 2005, 12:23 pm
Posts: 92
Chris wrote:
why a multi-line snippet can't be used in place of a single-line one.


I have a script (see over in the Scripts section) which reads a text file and dynamically builds menus. The "problem" is that I can only do very limited things in the menu handler: I need everything to be contained in one line with which I then feed either the Send or the Run command.

The whole thing would be much more powerful (and easier) if we had the ability to execute the contents of a variable -- but we've been there already, I think :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2005, 10:56 am 
Offline

Joined: June 16th, 2005, 12:23 pm
Posts: 92
@Chris: I've had a look at the AHK source code and I think I can provide you with a code snippet of less than ten lines that should implement a {wait nnn}, as outlined further up. Would you be willing to include this feature?

The thing is I can't actually do the patch here because I have no makefile for the sources (I am on the older VC6 and I never use the IDE, only makefiles). I could try to create one, sure, but not now. (Or do you happen to have one lying around somewhere? That would be, of course, much better.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2005, 4:17 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I don't have any make-files for VC6. But feel free to mail your source to support@autohotkey.com, preferably with a short explanation to remind me of what it does and its expected benefits.

Thanks.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group