Jump to content

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


Guy_
 Share

Recommended Posts

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

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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