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.

Align Text Button

Featured Replies

I would like to create a set of buttons that would control the text alignment of a field:

Button1=Left Justify

Button 2= Center

Button 3 = Right Justify

I've looked through ScriptMaker, and if it is already there I'm just totally missing it.

Any thoughts, ideas, samples out there?

Thanks in advance.

Therre is no native way to create buttons to do this. It may be possible through AppleScript.

Why not use the Format menu?

A possible workaround, if you want to align the entire field, is to make 3 calculated fields and overlay them as merge fields on the layout. Align the first one left, the second centre and the third one right. Use the buttons to enable one of the three fields like this:

LeftAligned = Case(gLeft;TextField;"")

MiddleAligned = Case(gMiddle;TextField;"")

RightAligned = Case(gRight;TextField;"")

The script attached to the Left button would be:

Set Field [gLeft; 1]

Set Field [gMiddle;0]

Set Field [gRight;0]

The script attached to the Middle button would be:

Set Field [gLeft; 0]

Set Field [gMiddle;1]

Set Field [gRight;0]

The script attached to the Right button would be:

Set Field [gLeft; 0]

Set Field [gMiddle;0]

Set Field [gRight;1]

  • Author

Okay...I give. I'm trying to implement BobWeaver's suggestion here...but I can't figure out what "gLeft", "gMiddle", and "gRight" are in the Case statements. Are those Globals? Do I make fields with those names? Help.

Thanks in advance.

Attached is my crack at this.

notes:

- you can not enter the field using the tab key because you need to run a script whenever a user tries to enter the Text field.

- When you use a button to align the text the color of the text in the Text field is set to white so that it matches the background. the Text field is also behind the three merge fields so the white text does not block out what the merge fields will display. Why set the text to white? Besides blending with the background you can search the Text field in find mode. (My original workaround simply put the contents of the Text field in one of the three alignment fields once a button was used. I then realized this would make finds complicated because the contents of the field would be spread over 4 fields.)

MyDB.zip

Hi mKirk,

tray this, Base is Attachment created by sbg2.

Difference is that in my attachment you need one script and one baton.

Happy Filemakering

Ino grin.gif

Sorry forget Attachment

Ino

MyDBI_InoType.zip

Nice and efficient. No explanation?

The trick is to have one of three alignment fields set with a fill color that matches the background and that field should be arranged in front of the text field. The other two alignment fields should have a transparent fill and be arranged in front of the filled field. All alignment fields should be set to NOT allow entry in Browse or Find Mode, the Text field should be allowed to be entered in both modes (no entry was allowed in Find mode in comments example). You also might want to allow advancement to the next field using the tab key.

Note: One potential problem? The user can break the ability to align the text using the provided buttons by using the align text buttons on the toolbar or by using Align Text from the Format menu.

I was a little disappointed to find that the text in a field will not export with (alignment) formatting unless the field has been aligned to something other than the default alignment.

If the user has access to Format menu or to the text formatting toolbar, then this is an excercise in futility. It may very well be even so...

  • Author

Thanks to all who posted replies...

comment...you nailed what I was looking for...I was just missing one thing from where you were.

And no, at least in my solution the user will not have access to Format, so this works great...thanks!

EXELENT

Ino tongue.gif

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.