Jump to content

Input / Output


Recommended Posts

Hello guys,

in beforehand: I have used autoit successfully in the past, but i am not very experienced.

Anyway what i would like to realize is this:

A script that i can run in the background and which gives an output (e.g a postalcode) based on input.  Also

i would like to implement a pause and escape function.  This is how far i have come from searching:

___________________________________________________________________________________

 

; Press Esc to terminate script, Pause/Break to "pause"


Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

;Body  ( Now how do i write the "if i enter Q or W or etc. then  send "52074" )
While 1
 ?

?
WEnd

Func TogglePause()
    $Paused = Not $Paused
     While $Paused
        Sleep(100)
        ToolTip('Script is "Paused"', 0, 0)
    WEnd
   
   
   
   Func Terminate()
    Exit 0
EndFunc   ;==>Terminate

Also for some reason i seem to be lacking an Endfunc but i can identify where.

Can someone help me ? 

Kind regards,

Patrick

Link to comment
Share on other sites

You have to end function TogglePause before starting a new function. You can't nest functions.

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

Hi PabeckTricker,

  This looks like the Example from the Help File... Except you took out the part that you need :)

Put back the "Show Message: Hotkey and change it to do what you want.

Try an InputBox and then have a look at  Select Case or Switch case to change the out come from the input.

If you get stuck, you know where we are.... ^_^

Good luck !

Bill

Link to comment
Share on other sites

On second glance, you may not need this:

Try an InputBox and then have a look at  Select Case or Switch case to change the out come from the input.

If all you want to do is send Postal Codes when a key is pressed.

Bu t I would consider using ALT or CTRL together with the key otherwise normal typing will be impossible....  :)

Edited by billo
Link to comment
Share on other sites

Hi PabeckTricker,

  This looks like the Example from the Help File... Except you took out the part that you need :)

Put back the "Show Message: Hotkey and change it to do what you want.

Try an InputBox and then have a look at  Select Case or Switch case to change the out come from the input.

If you get stuck, you know where we are.... ^_^

Good luck !

Bill

 

Hi Bill, yes this is what i found after googling. I tried as far as i came.  And regarding the normal typing thats what i would like to have the "pause" function for. But in general its filling in stupid tables so pressing alt+ctrl everytime would be a pain in the ass.

You have to end function TogglePause before starting a new function. You can't nest functions.

 

"Nest functions" ? 

Link to comment
Share on other sites

I'm afraid the pause function in the HotKeySet will not serve this purpose. Recently found that out myself...

Maybe use the F keys instead. F2, F3 etc

 

"Nest functions" ? 

You removed one or more of the FUNC ENDFUNC Declarations causing a nested Function (Function within a function)

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