Jump to content

How to Use autoIt-Scripts with TextpadMacros?


Recommended Posts

Hi there,

Today i heard about AutoIt and i am very impressed. It is fun to work with. Now i tried to enhance my Textpad with simple new funktions (calculation i. E.), which works fine in standard mode. So i can type 25*4 in Textpad (or Notepad) and by pressing a hotkey 100 will be inserted (not very impressive :P ...)

But now i tried to implement these function into Textpad Macros, but the Hotkeys do not record. So i created a loop like this:

While 1
Sleep('1')
if ClipGet() <> $cl Then
    _calc()
    $cl=ClipGet()
endif

Func _calc()
    $clipBak=ClipGet()
    Send("^c")
    $input=ClipGet()
    if StringRegExp ( $input, "[0-9]*\+[0-9]*" ) then
        $arr=StringSplit(ClipGet(),"+")
        [...]

So if i write 24+5 and press ctrl+c it copies into the clipboard and becomes replaced by 29, that works fine too, but is too slow to use with Macros...

Is there any possibility to stop Textpad for a while? Or any other possibility to manage this?

Thank you,

Thorsten

Link to comment
Share on other sites

Hi,

Execute is a cool feature, but unfortunately not the solution for my problem (the part execute would replace works fine). The Fact is, that the Macro is so fast, that it is some steps further, when the autoIt-Script returns the value.

Thanks,

Thorsten

Link to comment
Share on other sites

Hi,

Execute is a cool feature, but unfortunately not the solution for my problem (the part execute would replace works fine). The Fact is, that the Macro is so fast, that it is some steps further, when the autoIt-Script returns the value.

Thanks,

Thorsten

So what you want to do is slow down a textpad macro? if it's faster, then why use autoit for this part? i'm sorry, i don't mean to push you towards another scripting solution, i think that autoit can handle the entire job without the need for a textpad macro, with atleast comparable speed, but it seems like you're making your solution alot more complex than your problem. A while back i had to synchronize some VBA scripting with the execution of a compiled autoit script, i just made it so there was a file which each script would create or wait for to tell the two which should be working at any given millisecond. like...

excel sheet creates file 'toggle' then calls the autoit script

that script makes sure that the file is there, then does everything it needs to do before excel does anything

while that's happening, the excel script is waiting for the file to be deleted

once the autoit script is done, it deletes the file and waits for it to be created again...

i had to go that route because the 2 scripts had to interact with several other systems and interfaces each, and i wanted to make the timing as perfect as possible, but you're typically going to make your job alot easier just using one or the other, and it'll make a much quicker job of it.

That's just my $.02 of course though. If you'd like help making the whole thing an autoitscript, all you'd have to do is explain what exactly the macro is doing, and we can help you eliminate the need for the extra macro.

Link to comment
Share on other sites

Thank you for your helpful answer. I'll try to do it like this, although I hoped, that there was an easy way to stop textpad from outside, to have both macros (tp + autoit) synchronized.

I need TP-Macros for simple repetitive Tasks, that vary all the time. So it is fast to record them with TP and way too much work with autoit. But ist has its limitations. e.G. there is no way to count and calculate in TP, so i added this functionality (and some more) with AutoIt.

Thanks,

:P Thorsten

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