J.P. Posted June 5, 2002 Posted June 5, 2002 Hi, I was wondering from selecting from value list and running a script based on which value is selected. ex. Lets say there is field with value list defined. And by selecting one of those value from that field, can it have perform a script? Thanks in advance!
andygaunt Posted June 5, 2002 Posted June 5, 2002 Hi, this can be done (although a little clunky). you need your value list to be formatted as a pop-up list on a mac or a pop up menu on a pc. then you need to script it so that it pauses for 1 second and then checks to see if a selection has been made, otherwise loop back into the pause. Then, once a selection has been made, continue your script for the specific selection. As I said, this is clunky because if you add a new value to the list, you need to change the script to recognise that. So, off the top of me head Allow User Abort [Off] Go to field [ value list field ] Loop Pause/Resume script ["0:00:01"] Exit Loop If [ Status(CurrentFieldName) <> "value list field" ] End Loop # If you didnt select anything but leave the field then stop the script If ["IsEmpty(value list field) Exit Script End If # You selected something so lets see what it was and perform the relevant action If ["value list field = "abc"] Perform Script ["abc"] Else If ["value list field = "xyz"] Perform Script ["xyz"] # Continue to else if for all your required values End If End If This gives you a general idea. So, If you dont make a choice it stays in the loop. But if you tab out without making a choice the script runs, sees you didnt make a choice and stops. But, if you did make a choice it will see that choice and run the relevant script. So, there ya go. One way anyway. Personally, I use SCRIPTit for all this sort of work (yes, I know its a plugin and blah blah blah, but it gives so much flexibility). Anyhow. HTH
Recommended Posts
This topic is 8208 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now