Old 15th February 2021, 15:27   #1
wrighty369
Junior Member
 
Join Date: Feb 2021
Posts: 3
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
wrighty369 is offline   Reply With Quote
Old 15th February 2021, 20:33   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,538
Are you saying $COOKIEURL in MessageBox is blank?

Quote:
!define $COOKIEURL=$sURL
is not valid or does not do what you think it does.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th February 2021, 08:03   #3
wrighty369
Junior Member
 
Join Date: Feb 2021
Posts: 3
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 is offline   Reply With Quote
Old 16th February 2021, 08:47   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,538
$Text is not a random number, it is the handle to the text control you created.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 16th February 2021, 09:13   #5
wrighty369
Junior Member
 
Join Date: Feb 2021
Posts: 3
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?
wrighty369 is offline   Reply With Quote
Old 16th February 2021, 13:25   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,538
With
Quote:
Page Custom nsDialogsPage nsDialogsPageLeave
"url entered is $COOKIEURL" has the correct text when I use your code.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
nsis gettext

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump