September 16, 200223 yr Continuing in my quest to avoid cut'n'paste scripts... Is there any way to get the text label of a button in the script that it invokes? That way you could write one script that behaves appropriately for a large number of buttons, where all you need to do is give it the right label. For example, I could have a script like this: If [Mod(Status(CurrentModifierKeys), 2)] SetField(G::HelpText, GetField("HELP " & ?ButtonText?)) Else # do something else with the field with that name like set a default End If Without that, I end up writing a cut'n'paste script for each and every button. Thanks.
September 17, 200223 yr Author Have you considered using a field as a button or as the label on a button? Sure, but that just puts me into one of the other similar threads... if the script is generic, not specific to the field, then how do you know what field was clicked on or what its contents are? If I could do that, then problem solved. Can I?
September 17, 200223 yr This may help. I made 3 fields, Button, Label, gLabel_Capture. Button is a empty field and transparent. In Label I added some text. gLabel_Capture is a global text field where the contents of Label is to be placed. Set the tab order with Button immediately before Label. Then the following script: Go to Field["Button"] Go to Next Field Set Field["gLabel_Capture","Status(CurrentFieldContnets)"] Exit Record/Request This worked until another Button field is placed on the layout. The Go to Field step goes to the first occurance of Button on the layout. It does not look like you can use one script for every button. However, you can make a limited number of scripts to capture several labels. As an example, I am attaching a file with 3 scripts to capture 9 labels. Hope this helps Button_Sample.zip
Create an account or sign in to comment