How can I trigger a specific callback script based upon which item is selected from a Menu Item? For example, if Item#1 in the Menu is selected, it will trigger this callback script:
viewdisplay -N all l on *; viewdisplay -N all n on *; viewdisplay -N all m on *;
Then when I select Item#2, it will trigger this callback script:
viewdisplay -N all l off *; viewdisplay -N all n off *; viewdisplay -N all m off *;
Any ideas?
Call Back scripts with Menu Items in Otl
5155 4 1- vrljc
- Member
- 63 posts
- Joined: July 2005
- Offline
- goldfarb
- Staff
- 3456 posts
- Joined: July 2005
- Offline
- vrljc
- Member
- 63 posts
- Joined: July 2005
- Offline
Ok I am def going in the right direction now, but I am having some syntax issues I think. So far my script looks like this:
if(“ch(”display“)” == “0”)
then
message `on`
else
message `off`
endif
So this says that if I have Item#1 selected from the pulldown menu, it should return a message saying “on” and it should say “off” if #2 is selected. Well what is happening is that no matter which item i have selected, it is only returning “off.”
As a test that it is indeed finding ch(“display”), I added to the bottom:
message `ch(“display”)`
And it returned the correct 0 or 1. I guess I am just not writing the if/then/else statement correctly?
if(“ch(”display“)” == “0”)
then
message `on`
else
message `off`
endif
So this says that if I have Item#1 selected from the pulldown menu, it should return a message saying “on” and it should say “off” if #2 is selected. Well what is happening is that no matter which item i have selected, it is only returning “off.”
As a test that it is indeed finding ch(“display”), I added to the bottom:
message `ch(“display”)`
And it returned the correct 0 or 1. I guess I am just not writing the if/then/else statement correctly?
- jason_iversen
- Member
- 12527 posts
- Joined: July 2005
- Offline
vrljcHey there,
if(“ch(”display“)” == “0”)
then
message `on`
else
message `off`
endif
You're only suffering from bad syntax as far I can see:
Use backquotes to evaluate expressions - and not in the message commands either:
if(`ch(“display”)` == 0)
message ‘on’
else
message ‘off’
endif
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
- vrljc
- Member
- 63 posts
- Joined: July 2005
- Offline
-
- Quick Links