Sign in to follow this  
Followers 0
Scriptkiddi3

Spacer

9 posts in this topic

#1 ·  Posted (edited)

Hi, I've made a tiny script to make spaced text and send it to notepad. How can I send it when I hit CTRL-SHIFT-S for example? It shouldn't only work in notepad you see. Here is my code...

$input = InputBox("Spacer", "Text to 'Space':")
Run("notepad.exe")
WinWaitActive("Untitled - Notepad")
WinSetState("Untitled - Notepad", "", @SW_MAXIMIZE)
Sleep(200)
space($input)
;------------------------
Func space(ByRef $input)
$len = StringLen($input)
For $i = 1 to $len
    Send(StringMid($input, $i, 1), 1)
    If $i <> $len Then
        Send("{SPACE}")
    EndIf
Next
EndFunc

I am new to AutoIt so could anyone help me with this? :"> Thanks

Edited by Scriptkiddi3

[-"Scriptkiddie, nice to meet you!"-]

Share this post


Link to post
Share on other sites



You would need to use HotKeySet to setup execution using CTRL-SHIFT-S but as I am a newbie I do not know how to make it work with other editors.

:whistle::dance:



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hi, I've maid a tiny script to make spaced text and send it to notepad. How can I send it when I hit CTRL-SHIFT-S for example? It shouldn't only work in notepad you see. Here is my code...

HotKeySet("^+S","space")
HotKeySet("{PAUSE}","GETOUT")

while 1
sleep(100)
WEnd

Func space()
$input = InputBox("Spacer", "Text to 'Space':")
$spaced = ""
for $i = 1 to StringLen($input)
    if  $i = 1 Then
        $spaced = $spaced & StringMid($input,$i,1)
    Else
        $spaced = $spaced & " " & StringMid($input,$i,1)
    EndIf
    
Next
Send($spaced)
EndFunc
Func GETOUT()
    Exit
EndFunc

i setup your hotkey, and one to exit (pause key) and now it just sends to the active window

***edit***

fixed logic error...

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

You would need to use HotKeySet to setup execution using CTRL-SHIFT-S but as I am a newbie I do not know how to make it work with other editors.

:dance:  :dance:

<{POST_SNAPBACK}>

Anyway, thanks for your reply! :whistle:

[-"Scriptkiddie, nice to meet you!"-]

Share this post


Link to post
Share on other sites

if you have your function explicitly run notepad (like it does)... it's just going to work in notepad...maybe try this...

HotKeySet("^+S","space")
HotKeySet("{PAUSE}","GETOUT")
while 1
sleep(100)
WEnd
Func space()
$input = InputBox("Spacer", "Text to 'Space':")
$spaced = ""
for $i = 1 to StringLen($input)
    if $i mod 2 = 1 Then
        $spaced = $spaced & StringMid($input,$i,1)
    Else
        $spaced = $spaced & " " & StringMid($input,$i,1)
    EndIf
Next
Send($spaced)
EndFunc
Func GETOUT()
    Exit
EndFunc

i setup your hotkey, and one to exit (pause key) and now it just sends to the active window

<{POST_SNAPBACK}>

Thanks I'll give it a try!

[-"Scriptkiddie, nice to meet you!"-]

Share this post


Link to post
Share on other sites

Thanks I'll give it a try!

<{POST_SNAPBACK}>

i fixed a little logic error, updated the code in original post

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

HotKeySet("^+S","space")
HotKeySet("{PAUSE}","GETOUT")

while 1
sleep(100)
WEnd

Func space()
$input = InputBox("Spacer", "Text to 'Space':")
$spaced = ""
for $i = 1 to StringLen($input)
    if  $i = 1 Then
        $spaced = $spaced & StringMid($input,$i,1)
    Else
        $spaced = $spaced & " " & StringMid($input,$i,1)
    EndIf
    
Next
Send($spaced, 1)
EndFunc
Func GETOUT()
    Exit
EndFunc

T H A N K S F O R Y O U R H E L P ! < s o l v e d >


[-"Scriptkiddie, nice to meet you!"-]

Share this post


Link to post
Share on other sites

HotKeySet("^+S","space")
HotKeySet("{PAUSE}","GETOUT")

while 1
sleep(100)
WEnd

Func space()
$input = InputBox("Spacer", "Text to 'Space':")
$spaced = ""
for $i = 1 to StringLen($input)
    if  $i = 1 Then
        $spaced = $spaced & StringMid($input,$i,1)
    Else
        $spaced = $spaced & " " & StringMid($input,$i,1)
    EndIf
    
Next
Send($spaced, 1)
EndFunc
Func GETOUT()
    Exit
EndFunc

T H A N K S  F O R  Y O U R  H E L P !  < s o l v e d >

<{POST_SNAPBACK}>

np, glad i could help

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

HotKeySet("^S", "space")
HotKeySet("{PAUSE}", "closespacer")
While 1
    Sleep(100)
WEnd
;------------------------
Func space(ByRef $input)
$input = InputBox("Spacer", "Text to 'Space':")
$len = StringLen($input)
For $i = 1 to $len
    Send(StringMid($input, $i, 1), 1)
    If $i <> $len Then
        Send("{SPACE}")
    EndIf
Next
EndFunc
;------------------------
Func closespacer()
    Exit
EndFunc

Now i notice that i could make it my own. :whistle: Thanks for learning me the HotKeySet function!!!


[-"Scriptkiddie, nice to meet you!"-]

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  
Followers 0