Javascript access to "---"
Javascript access to "---"
How do i figure out the patchers --- number in a js file?
-
- Posts: 127
- Joined: Fri Sep 11, 2009 7:54 am
- Location: Paris
- Contact:
Re: Javascript access to "---"
The easiest way is to put something as argument to your js object, like "js yourawesomejsfile.js ---randomstuff". Then in your global code you can access to the argument of your js object (using jsarguments[1]) and then parse that string to get the number before randomstuff.Surreal wrote:How do i figure out the patchers --- number in a js file?
ej
Re: Javascript access to "---"
that ... didn't (seem to) work...but now that i think about it again, i think i know why.
when i open a patch in edit mode, that number is not generated.
thank you.
when i open a patch in edit mode, that number is not generated.
thank you.
-
- Posts: 127
- Joined: Fri Sep 11, 2009 7:54 am
- Location: Paris
- Contact:
Re: Javascript access to "---"
Yeah that must be it. Doing something like that seems to work fine:Surreal wrote:that ... didn't (seem to) work...but now that i think about it again, i think i know why.
when i open a patch in edit mode, that number is not generated.
Code: Select all
var id;
function findId()
{
var str = jsarguments[1];
id = str.replace(/(.+)randomtext/, "$1");
post(id);
}
findId();
ej