stringreplace not working Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
wryyymuda
Posts: 32
Joined: 21 Sep 2018, 21:43

stringreplace not working

15 Nov 2018, 13:28

hi, so i recently made a script that opens a gui and allowes you to enter text into 3 edits and replace certain characters in the first string.
i added a clipboard view to this and it was working but now it seems to have stopped working. any guesses?

Code: Select all

;;-----------------------------------------------------------[#start]-----------------------------------------------------------------;;
;//--\\ start is the place where i dictate variables and "#"s so the script wont scream at me.
#singleinstance, force
gui, add, text, w150 h20 x0 y0 vShowString, new string =
gui, add, edit, y20 x0 r1 w100 h20 vstring gsubmit, 
	gui, add, text, y22 x105 w70 h20 , original string
gui, add, edit, y45 x0 r1 w100 h20 vreplacstring gsubmit, 
	gui, add, text, y47 x105 w45 h20 , replacie
gui, add, edit, y70 x0 r1 w100 h20 vreplacetext gsubmit, 
	gui, add, text, y72 x105 w45 h20 , replacer
gui, add, button, x0 y91 gReplacestring, click to replace
gui, add, button, x180 y0 w120 h20 gclipbaordcontents, get clipboard contents
gui, add, edit, readonly r10 w120 h400 x180 y20 vclipboardcontent, clipbaord content = `n "%clipboard%"
gui, show, w300 h220
return
;;-----------------------------------------------------------[#open_code]-------------------------------------------------------------;;
;//--\\ where the majority of the gui and code is handled
;//--\\ none needed 

return
;;-----------------------------------------------------------[#hotkeys]---------------------------------------------------------------;;
;//--\\ where the hotkeys are handled and if needed code
;//--\\ none needed

return
;;-----------------------------------------------------------[#gosub_nothotkeys]-------------------------------------------;;
;//--\\ for labels
;//--\\ all the code is located here, this is because i dont want 
ReplaceString:
	stringreplace, string, string, %replacestring%, %replacetext%, 1
	guicontrol,text , ShowString, new string = %string%
	guicontrol, text, string, %string%
	return
submit:
	gui, submit, nohide
	guicontrol,text , ShowString, new string = %string%
	return
clipbaordcontents:
	guicontrol, text, clipboardcontent, clipbaord content = `n "%clipboard%"
	return
guiclose:
	exitapp
	return
return
User avatar
Scr1pter
Posts: 1192
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: stringreplace not working  Topic is solved

15 Nov 2018, 15:42

Hi,
First you should get rid of all the typos.
Clipboard instead of clipbaord.

Can't test your script right now.

Regards
Please use [code][/code] when posting code!
Keyboard: Logitech G15 FE - Mice: Logitech G9 FE, G502 FE, G602, Jelly Comb Touchpad - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.32.00

Return to “Ask For Help”

Who is online

Users browsing this forum: 2ndprotocol, Bing [Bot], Chunjee, guivho, Raymond888, Slapx and 73 guests