Skip to content
⌘ NSIS Forum Archive

NSIS Get Text

6 posts

wrighty369#

NSIS Get Text

Hi,
I am new to the forum and also NSIS. I am after some help please as I seem to be hitting a brick wall.

I am currently using nsdialogs whereby the user types in a url, this url is then used further down the script to create the shortcuts. However, the one part that isn't working is the NSD_GetText command. It is returning blank data. Please see below what I currently have. I would welcome any suggestions:

Function nsDialogsPage

nsDialogs::Create 1018
Pop $Dialog

!insertmacro MUI_HEADER_TEXT "Type in the customers Full URL" ""

${If} $Dialog == error
Abort
${EndIf}

${NSD_CreateLabel} 0 0 100% 25% "It should look similar to one of the following: $\r$\n$\r$\nhttp://www.url.co.uk"
Pop $Label

${NSD_CreateText} 0 25% 100% 13u ""
Pop $Text
#${NSD_OnChange} $Text nsDialogsPageTextChange
;...
;...

nsDialogs::Show

FunctionEnd

Function nsDialogsPageLeave

${NSD_GetText} $Text $COOKIEURL

MessageBox MB_OK "url entered is $COOKIEURL" #My test to see if I get the expected result



StrCpy $sURL $COOKIEURL



!define $COOKIEURL=$sURL
# MessageBox MB_OK "The URL entered is $\n$\n$sURL"
FunctionEnd
Anders#
Are you saying $COOKIEURL in MessageBox is blank?

!define $COOKIEURL=$sURL
is not valid or does not do what you think it does.
wrighty369#
Hi Anders,
Thanks for the reply, Yes the $COOKIEURL is blank. $Text just returns a random number.

The Define part I thought that it then changes the COOKIE URL variable and what is in it to a different variable named $sURL. From what you are saying I may be wrong about that
wrighty369#
Ahh ok, thanks, as I say I'm new to this so sorry if I am asking silly questions :/ but is there any reason from the above that you can see as to why the Get Text would not return the text entered?
Anders#
With
Page Custom nsDialogsPage nsDialogsPageLeave
"url entered is $COOKIEURL" has the correct text when I use your code.