rayh34 Posted February 3, 2007 Posted February 3, 2007 I have created a script that sets the find/sort criteria according to one of 6 possible buttons, plus a default setting. It works, but just seems clunky and repetitive, and wanted a more experienced person to see if there is a cleaner, slicker way of doing the same thing. I was originally was going to use "Get(lastActiveObject)" to define what button was pushed until I found out that it does not work with buttons! The attached file basically just contains the script file. Date_Calc_Test.zip
mr_vodka Posted February 3, 2007 Posted February 3, 2007 Hey Ray, Use a script parameter instead. When defining your button, pick the script that you want the button to envoke and you will see a field on the bottom of the window to enter a script parameter. Then in your script, use the Get (ScriptParameter) function to test. So, you can simplify the script to have something like If Get (ScriptParameter) = 1 ... Else If Get (ScriptParameter) = 2 ... End If
comment Posted February 3, 2007 Posted February 3, 2007 It seems you could also group the common steps and place them OUTSIDE the If[] statement/s, instead of repeating them for each case.
rayh34 Posted February 3, 2007 Author Posted February 3, 2007 Cool, just cleaned out almost half my scripts! Thanks.
Recommended Posts
This topic is 6505 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