FORUMS: list search recent posts

Random Function in ExtendScript?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Nate Hanson
Random Function in ExtendScript?
on Jun 12, 2013 at 3:58:17 pm

I've been looking for the last couple of days (online and in the Adobe Scripting Guide) and I can't find an answer. Is there a way to generate random numbers in ExtendScript?

Thanks in advance for your help,
Nate

Nate Hanson
Pilothouse Films


Return to posts index


Xavier Gomez
Re: Random Function in ExtendScript?
on Jun 12, 2013 at 4:30:40 pm

Math.random()

- has no arguments
- returns a number in [0,1[
- there is also no counterpart of AE's seedRandom() (hopefully wrong)

Xavier


Return to posts index

Nate Hanson
Re: Random Function in ExtendScript?
on Jun 12, 2013 at 4:44:29 pm

Great! Thanks, Xavier!

One more question - If I want to share my script with others, how can I make sure that the necessary math.js files travel with my script?

Nate

Nate Hanson
Pilothouse Films


Return to posts index


Xavier Gomez
Re: Random Function in ExtendScript?
on Jun 12, 2013 at 5:38:33 pm

You mean you have some #include instructions (#include "file.jsxinc")? If so, the simplest thing to do is to physically include external .js file in the main one and send just one file, unless you want to hide some part of the code...
Sorry, not sure i understand.

Xavier

(Hmm, just realized that '#' automatically creates a link. Not intentionnal.)


Return to posts index

Nate Hanson
Re: Random Function in ExtendScript?
on Jun 12, 2013 at 5:41:11 pm

You answered it perfectly, that's exactly what I was wondering. So I will need to essentially copy and paste the necessary pieces of the library into my own script. That makes sense.

Thanks, Xavier! I appreciate it!

Nate

Nate Hanson
Pilothouse Films


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]