Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can I get the text label of a button in its script

Featured Replies

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.

Have you considered using a field as a button or as the label on a button?

  • 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?

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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.