i need ask about generating random sting after url, like url parameter
Copy link to clipboard
Copied
Hii,
anyone know how to generate random string or number , after url link? i was try like this :
var lower = 0; var upper = 100000000;
var url = "http://www.mypage.com/index.php?"+(Math.floor(Math.random()*(upper-lower))+lower)
windows.open("url");
but the button can't open my url.
thanks
Copy link to clipboard
Copied
Post the question only once.
Copy link to clipboard
Copied
im sorry..
Copy link to clipboard
Copied
What version of Adobe Acrobat do you use?
Copy link to clipboard
Copied
adobe acrobat 18.011
Copy link to clipboard
Copied
Open the console with ctrl-j and look for error messages.
Copy link to clipboard
Copied
ReferenceError: window is not defined
1:Link:Mouse Up
SyntaxError: syntax error
1:Console:Exec
undefined
SyntaxError: syntax error
1:Console:Exec
undefined
SyntaxError: syntax error
1:Console:Exec
undefined
SyntaxError: syntax error
4:
SyntaxError: syntax error
4:
SyntaxError: missing ; before statement
1:Console:Exec
undefined
SyntaxError: missing ; before statement
1:Console:Exec
undefined
ReferenceError: upper is not defined
1:Console:Exec
undefined
ReferenceError: upper is not defined
1:Console:Exec
undefined
ReferenceError: upper is not defined
1:Console:Exec
undefined
ReferenceError: upper is not defined
1:Link:Mouse Up
ReferenceError: upper is not defined
1:Link:Mouse Up
Copy link to clipboard
Copied
What is windows.open expected to do? I do not recognise this.
Also, I think you retyped your code. Please copy and paste the actual code (but change URL only)
Copy link to clipboard
Copied
Try this:
var lower = 0; var upper = 100000000;
var url = "http://www.mypage.com/index.php?"+(Math.floor(Math.random()*(upper-lower))+lower);
app.launchURL(url);
Copy link to clipboard
Copied
You should not name your variable "url", since there's a built-in property with that name and it might conflict. Use myURL, or something.
Copy link to clipboard
Copied
The OP uses this name.
Copy link to clipboard
Copied
I understand, but it should be changed none the less...
Copy link to clipboard
Copied
it show errors like this:
ReferenceError: window is not defined
1:Link:Mouse Up
SyntaxError: syntax error
1:Console:Exec
undefined
SyntaxError: syntax error
1:Console:Exec
undefined
SyntaxError: syntax error
1:Console:Exec
undefined
SyntaxError: syntax error
4:
SyntaxError: syntax error
4:
SyntaxError: missing ; before statement
1:Console:Exec
undefined
SyntaxError: missing ; before statement
1:Console:Exec
undefined
ReferenceError: upper is not defined
1:Console:Exec
undefined
ReferenceError: upper is not defined
1:Console:Exec
undefined
ReferenceError: upper is not defined
1:Console:Exec
undefined
ReferenceError: upper is not defined
1:Link:Mouse Up
ReferenceError: upper is not defined
1:Link:Mouse Up
Copy link to clipboard
Copied
You need to select the entire code before running it.
Copy link to clipboard
Copied
it works, but must open adobe acrobat first, when im open in browser or in email attachment it not work
Copy link to clipboard
Copied
Sure, you need to use an Adobe product.
Copy link to clipboard
Copied
do you have any soution?Test Screen Name​
Copy link to clipboard
Copied
Yes you need to use an Adobe product. Download and open in Reader.
Copy link to clipboard
Copied
can i use window.open function?
Copy link to clipboard
Copied
Not from within the PDF file.

