Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
could anyone please provide a simple example how to get QV-Variables and assign them to javascript variables?
The posts I found are quite confusing and I can't get it to work with my script.
For example I want to pass a input box variable to javascript.
I use QV 11R6.
Thank you,
Thorsten
Have you tried like:
Set var=ActiveDocument.GetVariable("Vriablename") ?
Or
Set var=ActiveDocument.Variables("Vriablename")
I put it in here:
Qv.LoadExtensionScripts(jsFiles, function () {
Set varabc = ActiveDocument.GetVariable("var1") ;
});
It gives me an error: expecting ";"...
A working example would be nice.
Sorry, I should have noticed earlier that you are looking for JS. The above code is VBScript. I am not sure if variable of a qv doc can be referred using JS in extension. May be Brian Munz can help you.
Use the template provided by Stefan Walter here. Then use the add the following code inside your extension_Done function:
In the definition file set a text field:
<Text Label="MyVariable" TargetName="$(variable here)" Type="text" Width="30%" Expression=""/>
and use the text in your Script as so:
var myVariable= _this.Layout.Text0.text.toString();
Know you can use the MyVariable how ever you like in your script.
check your console = console.log(myVariable);
Thanks, I think I got it right now.