February 3, 200719 yr 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
February 3, 200719 yr 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
February 3, 200719 yr It seems you could also group the common steps and place them OUTSIDE the If[] statement/s, instead of repeating them for each case.
Create an account or sign in to comment