Urgent Request Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Guest

Urgent Request  Topic is solved

18 Jan 2018, 17:09

Hi, I need a script where I press f1 to open a MsgBox, where I will then input a sentence into that MsgBox and it will input that sentence into this website http://www.togglecase.com/reverse_text which will then generate the text backwards and will go straight to my clipboard to which I will then paste into my text box. Please help.
User avatar
boiler
Posts: 16915
Joined: 21 Dec 2014, 02:44

Re: Urgent Request

18 Jan 2018, 19:34

It would be easier to have AHK just reverse the text itself and not bother with the website. Especially if it's urgent.

Code: Select all

MsgBox, % ReverseText("Hello, world!")
return

ReverseText(input)
{
	loop, % StrLen(input)
		output .= SubStr(input, 1 - A_Index, 1)
	return output
}
This is just a demo of the function to reverse the text. You need to put the other stuff around it. You are using the wrong terminology when you say "MsgBox".
User avatar
boiler
Posts: 16915
Joined: 21 Dec 2014, 02:44

Re: Urgent Request

18 Jan 2018, 19:44

OK. I did it for you.

Code: Select all

F1::
InputBox, MyText, Reverse Text, Enter your text to be reversed:,, 625, 135
Clipboard := ReverseText(MyText)
MsgBox, Your reversed text is in the clipboard ready to be pasted.
return

ReverseText(input)
{
	loop, % StrLen(input)
		output .= SubStr(input, 1 - A_Index, 1)
	return output
}
Guest

Re: Urgent Request

18 Jan 2018, 20:20

boiler wrote:OK. I did it for you.

Code: Select all

F1::
InputBox, MyText, Reverse Text, Enter your text to be reversed:,, 625, 135
Clipboard := ReverseText(MyText)
MsgBox, Your reversed text is in the clipboard ready to be pasted.
return

ReverseText(input)
{
	loop, % StrLen(input)
		output .= SubStr(input, 1 - A_Index, 1)
	return output
}
Thank You So Much
I edited it this way so as to automatically insert (paste) into my textbox

Code: Select all

F1::
InputBox, MyText, Reverse Text, Enter your text to be reversed:,, 625, 135
Clipboard := ReverseText(MyText)
Send ^v

ReverseText(input)
{
	loop, % StrLen(input)
		output .= SubStr(input, 1 - A_Index, 1)
	return output
}
Guest

Re: Urgent Request

18 Jan 2018, 20:32

boiler wrote:OK. I did it for you.

Code: Select all

F1::
InputBox, MyText, Reverse Text, Enter your text to be reversed:,, 625, 135
Clipboard := ReverseText(MyText)
MsgBox, Your reversed text is in the clipboard ready to be pasted.
return

ReverseText(input)
{
	loop, % StrLen(input)
		output .= SubStr(input, 1 - A_Index, 1)
	return output
}
Would you know if there is one to unscramble words?
User avatar
boiler
Posts: 16915
Joined: 21 Dec 2014, 02:44

Re: Urgent Request

18 Jan 2018, 20:37

People have done similar things. Check out threads like this:
https://autohotkey.com/board/topic/3391 ... -scrabble/
Guest

Re: Urgent Request

19 Jan 2018, 12:01

boiler wrote:People have done similar things. Check out threads like this:
https://autohotkey.com/board/topic/3391 ... -scrabble/
Btw, How did you know that AHK could Reverse Text like that? Is there a list of commands that like AHK can do? If so could you kindly refer me to it or list some out.
Like is there other things that AHK can do to a text or something? and other commands too.
User avatar
boiler
Posts: 16915
Joined: 21 Dec 2014, 02:44

Re: Urgent Request

19 Jan 2018, 14:50

AHK by itself isn't able to reverse text. It is able to manipulate strings, and I wrote code to create the backwards string of characters by taking each of the characters of the original string and working backwards put them into a new string. The ReverseText function isn't something that exists in AHK. It is something I wrote specifically per your request. I don't know how much you know about programming, but basically there won't be commands to do exactly what your end goal is. You write code using logic and the commands/functions of the language to have it perform what you want it to do.

Click on the "Commands" link at the top of this web page to see a list of the AHK commands. You won't find ReverseText among them because, as I said, I wrote it using more basic building blocks of commands. You might want to click on the "Tutorial" link also so you can get up to speed on how AHK works.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Urgent Request

19 Jan 2018, 15:07

@boiler
have you tried the linked converter already? It's not only reversing the order of characters, it vertically mirrors every single character.
User avatar
boiler
Posts: 16915
Joined: 21 Dec 2014, 02:44

Re: Urgent Request

19 Jan 2018, 16:22

Huh? You mean the link in the OP? It's not doing that for me.
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Urgent Request

19 Jan 2018, 16:57

boiler wrote:Huh? You mean the link in the OP? It's not doing that for me.
Erm, you are right! I've used it a day ago and, kinda wishfull thinking, 'remembered' it that way :roll:
Maybe I shouldn't have used the worst test case scenario: bobo <> obob <> dodo <> odod :shh: :lol:

Here's what I thought to have seen: http://www.messletters.com/en/mirrored/ :shh:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, doodles333, Google [Bot] and 383 guests