Jump to content
Sign in to follow this  
Guy_

Can a loop be sped up? (WordPad char. selection)

Recommended Posts

Guy_

I'm pasting a URL into WordPad and after some commands I want just the URL to be automatically reselected.

Because of text under it and varying length urls that may split, I've only been able to do it perfectly with a loop that does Shift+{RIGHT} for each character in WordPad.

However, depending upon url length, remarkably it is taking from 2 to maybe 5 seconds.

Could I speed this up somehow? I was expecting this to be instant...

This is my loop:

Local $i = 0
While $i < $lengthURL
Send("+{RIGHT}")
$i = $i + 1
WEnd

Are other loop techniques faster maybe?

Is there an "accelerate" command?

(I've tried other tricks by adding a @CR before the url first, putting it on its own line and using Shift+End and Shift+Down, but I still can't get that to work perfectly every single time, so a faster loop would seem to be ideal)

Thanks!

Edited by Guy_

Share this post


Link to post
Share on other sites
water

You could use

AutoItSetOption("SendKeyDelay", 0)
at the beginning of your script to reduce the wait time between the Send commands.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Guy_

Thx! I had my hopes up, but if it's faster, it doesn't seem so by very much...

Share this post


Link to post
Share on other sites
Guy_

Seems about the same speed as when I keep down these keys manually.

So it seems it may be a built-in auto-repeat behavior / restriction in Windows or WordPad?

Share this post


Link to post
Share on other sites
water

Sending Shift+End to select the whole URL doesn't work for you?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Guy_

Depends on how long the URL is.

I might try using different strategies depending on the url length, but it still won't always be perfect.

I'm onto a new idea now...

I'll paste in text & @CR first, decrease point size right after it to minimum and paste the url in after that. At least it will always fit a line and I may be able to manipulate it more reliably with Shift+Home and just select the url perfectly every time.

Sadly, it will still depend on whether it splits as well, unless I leave it at the bottom on its own line always.

I think I'll do that and give the paste macro a 2nd click function to backspace the url to the previous line if so wished. Sounds good.

Edited by Guy_

Share this post


Link to post
Share on other sites
water

Why do you need the URL to be selected? Is it for the user to work with?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-12-03 - Version 1.4.11.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Guy_

I'm making a multi-clipboard like tool and I'm automatically includiing the URL to go after all copied snippets.

But sometimes you don't care for the url, so if it's already selected, you can delete it easily.

I believe my last (updated) idea will make me happy, because it gives extra choice as well :)

Edited by Guy_

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  

×