mxj net.local to a umenu
Hi
Retrieving my ipaddress via mxj net.local but I don't like the way it works in the example help file with the umenus. Once populated, even through the first one looks like it is selected you have to click and release on it to put it into effect.
I'm only interested in getting en1 so I'm doing this
loadbang
|
en1
|
mxj net.local
and that spits out:
clear, append 111.111.1.11, append fe80:0:0:0:217:f2ff:fee7:98f5%6
how do I tell when the mxj net.local is finished outputting or count the output so I can bang the umenu to actually use the first one (111.111.1.11 in the example above)?
Garrett
Try using [regexp] to pick out the one that looks like an IP address, here's an example.
lh
hi, can you show me a screen shot of what you have done, I'm on 4.6. Not sure why I need to pull out the IP address, surely I need to count whats coming out of mxj net.local?
Garrett
scratch that, clearly I didn't have my brain with me yesterday when I was coding, it's just a matter of using a trigger in front of the mxj net.local object to time the bang at the end of the output (as below and not a regexp in sight phew!). I will now go and slap myself on the back of the head - thanks for your help.
Garrett
Oops. It was a [route append] followed by [regexp ((?:\d{1,3}\.){3}\d{1,3})] but your method works just as well.
lh
ah ok, I try to avoid regular expressions if possible, they are useful but a nightmare to write.
I missed a bang in mine, works better now!