Keeping Multiline format in a variable

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

Keeping Multiline format in a variable

19 Apr 2018, 14:47

I have an AHK solution and it involves a multiline text field in a GUI.

When i enter the multiple lines of text in the field on the GUI form it saves the data in a variable.

Then that variable displays on a msg box as multiline

However when i call that variable in the body of an email (during the same AHK function) it displays the variable with all the multiple lines of text all together together and does not break them out on multiple lines like in the original form entry.

How can i make a multiline text field assign to a variable and then when called or written in an email, keep the same multi line format.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Keeping Multiline format in a variable

19 Apr 2018, 15:49

post some sample code that aint working
erik

Re: Keeping Multiline format in a variable

20 Apr 2018, 04:26

^8::
Gui, Add, Text, x6 y6 w250 h250 , Comments Translator
Gui, Add, Text, x6 y36 w250 h250 , Loan.
Gui, Add, Text, x6 y66 w250 h250 , Sec. Deposit.
Gui, Add, Text, x6 y96 w250 h250 , Trade In.
Gui, Add, Text, x6 y126 w250 h250 , Advance $.
Gui, Add, Text, x6 y156 w250 h250 , E-Lift Quote #.
Gui, Add, Text, x6 y186 w250 h250 , Legal Name.
Gui, Add, Text, x6 y216 w250 h250 , Application ID.
GUI,Add,Text,x6 y246 w250 h250,List Serial Numbers:

Gui, Add, Edit, vedit1 x80 y36 w150 h20 ,
Gui, Add, Edit, vedit2 x80 y66 w150 h20 ,
Gui, Add, Edit, vedit3 x80 y96 w150 h20 ,
Gui, Add, Edit, vedit4 x80 y126 w150 h20 ,
Gui, Add, Edit, vedit5 x80 y156 w150 h20 ,
Gui, Add, Edit, vedit6 x80 y186 w150 h20 ,
Gui, Add, Edit, vedit7 x80 y216 w150 h20 ,
GUI,Add,Edit,vSerial r10 w250 , //multi line text box allows me to enter in multiples lines of text
Gui, Add, Checkbox, vShipToBillingAddress, Ship to billing address?,
Gui, Add, Button, x61 y400 w40 h30 , Ok
Gui, Add, Button, x120 y400 w40 h30 , Cancel
Gui, Show,, Multiple Input Box.

Return
buttonCancel:
gui, GuiClose:
msgbox, "You canceled the app"
ExitApp
buttonok:
gui, submit
msgbox, %edit1%`n%edit2%`n%edit3%`n%edit4%`n%edit5%`n%edit6%`n%edit7%`n%edit7%`n%Serial% //multi line text that I entered shows up in a message box as a multiline text
var1=
(
1)Loan: %edit1%`r
)
var2=
(
2)Security Deposit: %edit2%`r
)
var3=
(
3)Trade In: %edit3%`r
)
var4=
(
4)Advance$: %edit4%`r
)
var5=
(
5)E-Lift Quote Number: %edit5%`r
)
var6=
(
6)Legal Name: %edit6%`r
)
var7=
(
7)Input 7: %edit7%`r
)
var8=
(
8)Serial: %Serial%`r //multiline text entry is saved as avariable
)

Run, mailto:[email protected]?subject=Comments Translator coming in. &body=%var1%`%0A%var2%`%0A%var3%`%0A%var4%`%0A%var5%`%0A%var6%`%0A%var7%`%0A%Serial% //when the variable with the multiline text is passed into the body of an email it shows up as one line of concatenated text and not multiple lines of text
erik

Re: Keeping Multiline format in a variable

20 Apr 2018, 08:18

where should i use <BR> i understand how to get the variables to show up on multiple lines.

I'm just not sure how to get a text box that is multiline to be saved as a variable and then show up as multiple lines of text when called into the body of an outlook email message
EmailExpert

Re: Keeping Multiline format in a variable

20 Apr 2018, 08:25

erik wrote:where should i use <BR> i understand how to get the variables to show up on multiple lines.

I'm just not sure how to get a text box that is multiline to be saved as a variable and then show up as multiple lines of text when called into the body of an outlook email message
instead of %0A use the br code tag, see if it helps
erik

Re: Keeping Multiline format in a variable

20 Apr 2018, 08:43

that's not it. that is for separating the unique variables from each other. I want to keep the multiline text box to show up as multiline text in an email
EmailExpert

Re: Keeping Multiline format in a variable

20 Apr 2018, 11:20

erik wrote:that's not it. that is for separating the unique variables from each other. I want to keep the multiline text box to show up as multiline text in an email
Do you even know what %0A does?

The arrogance you are displaying here is terrifying!
erik

Re: Keeping Multiline format in a variable

20 Apr 2018, 13:52

i believe %0A is new line correct?

when i enter <BR> it throws an error saying illegal character

not sure what you mean about the arrogance thing.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Keeping Multiline format in a variable

20 Apr 2018, 15:16

jesus, traditional syntax srsly needs to die, what a monstrosity

Code: Select all

Gui, Add, Text, x6 y6 w250 h250 , Comments Translator
Gui, Add, Text, x6 y36 w250 h250 , Loan.
Gui, Add, Text, x6 y66 w250 h250 , Sec. Deposit.
Gui, Add, Text, x6 y96 w250 h250 , Trade In.
Gui, Add, Text, x6 y126 w250 h250 , Advance $.
Gui, Add, Text, x6 y156 w250 h250 , E-Lift Quote #.
Gui, Add, Text, x6 y186 w250 h250 , Legal Name.
Gui, Add, Text, x6 y216 w250 h250 , Application ID.
Gui, Add, Text, x6 y246 w250 h250, List Serial Numbers:

Gui, Add, Edit, vedit1 x80 y36 w150 h20 ,
Gui, Add, Edit, vedit2 x80 y66 w150 h20 ,
Gui, Add, Edit, vedit3 x80 y96 w150 h20 ,
Gui, Add, Edit, vedit4 x80 y126 w150 h20 ,
Gui, Add, Edit, vedit5 x80 y156 w150 h20 ,
Gui, Add, Edit, vedit6 x80 y186 w150 h20 ,
Gui, Add, Edit, vedit7 x80 y216 w150 h20 ,
Gui, Add, Edit, vSerial r10 w250 , //multi line text box allows me to enter in multiples lines of text
Gui, Add, Checkbox, vShipToBillingAddress, Ship to billing address?,
Gui, Add, Button, x61 y400 w40 h30 , Ok
Gui, Add, Button, x120 y400 w40 h30 , Cancel
Gui, Show, , Multiple Input Box.

Return
buttonCancel:
Gui, GuiClose:
msgbox, "You canceled the app"
ExitApp

buttonok:
Gui, submit
formattedMailingString := generateMailingString()
MsgBox, % formattedMailingString
Run, % formattedMailingString
return


generateMailingString() {
	global ;required to access Gui EditControl's vVariables

	;for convenience
	separator := "%0A"
	email := "[email protected]"
	subject := "Comments Translator coming in."

	result := "mailto:" . email
			. "?subject=" . subject . " &body="
			. "1)Loan:" . edit1 . separator
			. "2)Security Deposit:" . edit2 . separator
			. "3)Trade In:" . edit3 . separator
			. "4)Advance$:" . edit4 . separator
			. "5)E-Lift Quote Number:" . edit5 . separator
			. "6)Legal Name:" . edit6 . separator
			. "7)Input 7:" . edit7 . separator
			. "8)Serial:" . Serial 
	
	return result
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Araphen, Descolada, Joey5, JPMuir, KolaBorat, matt101 and 175 guests