Jump 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.

Featured Replies

I have a database tha have had three different developers before me. Unfortunately all of them has had their own standards regarding field names and none the strength to change old parts. What I want to do is give these fields new names and set a standard. In many of these fields I only want to change the first part of the name.

Is there any easy way to do this to many fields at the same time? In a earlier post in the this forum I read about a external program, AUtoIT, that could give some help. But I would love if there was a way in FM to do this.

I'm using FM 5 Pro and server, where the server is a WIN NT 4 and the clients both PC and MAC.

There's no way with FileMaker alone to change the names of fields en masse. I also don't know of any third party tool that would help with this, but if you find AUtoIT useful, let us know.

Chuck

  • Author

Thanks for the answer Chuck. I will try this AutoIT and be back with feedback.

//Henkan

  • Author

smile.gif AutoIt did realy solve my problem. Big thanks to Thom who posted the suggestion and a example script back in november last year Thoms post .

I did create a script that asks for what you want to change in a field name and what you want to replace it with. Then it check in the Define fields list for matches and replace if there is. There must be more than I who want to change more than one fieldname at a time so I can recommend AutoIt to all Windows users. You find it at AutoIt and it is free. Here are my code as a example. Remember to save a copy of your database before using it.

code:


; Script to change part of field names in FileMaker

; =================================================

;

; OS: Windows 9x/NT

; Author: Henrik Ahlgren ([email protected])

;

; This script was written to change search for fieldnames and change it if there is any

; match.

;

MsgBox, 4, Change field names, This script is to search for part of fieldnames and change that part if there is any match. Make sure that you have the right FileMaker file open! Make sure the Define fields dialog has the option "custom order" chosen for sorting the fields! Do you want to proceed?

IfMsgBox, No, Goto, stop

; Asks for wich values should be changed and with what.

variables:

InputBox, OldFieldName, Fieldname contains, Please enter what part in the fieldname you want to change.

InputBox, NewFieldName, New fieldname, Please enter what you want to change to.

MsgBox, 4, Criterias, You want to change %OldFieldName% to %NewFieldName%. Is this correct?

IfMsgBox, NO, Goto, change

; Rename the fields

;

; Go fast

SetKeyDelay, 1

SetWinDelay, 1

; Get FileMaker's attention

attention:

WinActivate, FileMaker Pro

WinMaximize, FileMaker Pro

IfWinNotActive, FileMaker Pro,, Goto, attention

; Open define fields

Send, +^d

; Get first field name

Send, +{TAB}{SPACE}{TAB}^c

rename:

; Exit rename when the last fieldname has been renamed.

IfEqual, check, %clipboard%, Goto, confirmation

; Counter

SetEnv, temp, 0

SetEnv, counter, %temp%+1

; Search for value to change

SetEnv, input, %clipboard%

StringReplace, output, input, %OldFieldName%, %NewFieldName%

; Sets variable for loopexit

SetEnv, check, %output%

; Goes to next field if there is no match

IfEqual, input, %output%, Goto, copyname

; Set new fieldname and save

SetEnv, clipboard, %output%

Send, ^v{TAB}{TAB}{TAB}{ENTER}

; Get next fieldname

copyname:

Send, +{TAB}{DOWN}{TAB}^c

IfEqual, clipboard, AutoIt Clipboard owerflow, Goto, copyname

Goto, rename

;Gives a confirmation when it the names has been changed.

confirmation:

Send, {TAB}^k

MsgBox, 0, Comfirmation, %OldFieldName% has now changed to %NewFieldName% in %counter% fieldnames!

Goto, change

; Run again with new values or exit

change:

MsgBox, 4, Change, Do you want to put in new values?

IfMsgBox, YES, Goto, variables

Goto, stop

; Exit the script

stop:

MsgBox, 4, Quit, Do you want to exit this script?

IfMsgBox, NO, Goto, variables

Exit

This forum is GREAT!

//Henkan

Create an account or sign in to comment

Important Information

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

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.