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.

Add records and Sort

Featured Replies

I am really stumped on how to write a script to do this or even if it is possible to do.

Please note that the only funtion this layout has is to provide a tab-delimited text file

to automate data publishing in Adobe Indesign.

I have an employee database with a field "Department" It contains various Department names.

See Employees.fp7

So I was thinking of a script that loops and adds a new record each time the "Department" field changes

and puts the loop number into the "PositonNumber" field and the Department name

in the "DepartmentBanner" field then finally ends up sorted by "PositionNumber" ascending.

See Picture 3.pdf

Picture_3.pdf

Employees.fp7.zip

Edited by Guest

I have attached an example that just builds what you want to export into a global Text field called g_DepartmentExport. I also added g_CurrentPoistion (obvious) and g_CurrentDeptBan (hopefully also obvious).

Just in case I didn't make it obvious in the script you can insert a Tab in FileMaker by pressing ctrl+tab. I probably wasn't as wordy as I could have been with the Comments in the script but ask questions if you have any.

After it builds the text field it is set to Export Field Contents and will ask you to specify where to export to, pick a destination and save the file. Try an import into Indesign, if you encounter problems you will have to add a few more steps to the script.

Employees.zip

  • Author

Wow!

Thanks for your work on this.

The text file is exactly what I need for a data

import into Indesign. I will have to test that part with Applescript tomorrow.

  • Author

Thanks for your help sbg2:

I now have a need to pad the text file if the Department Banner falls at the end of a row in InDesign.

In other words if it falls at 4 or any multiple of 4.

I have duplicated your script (See script "ExportDepartment-PlugAt4" in attached file.)

and added some conditionals that allows for for 4 or 8.

My question is: How do I create a calculation within the conditional statment in the

script to allow for 4 or multiples of 4

without having to write a whole list of if statements.

Employees3.fp7.zip

If [Mod(g_CurrentPosition;4) = 0]

Mod returns the remainder after dividing two numbers, in this case g_CurrentPosition divided by 4. If your Position is a multiple of 4 their will be no remaider.

  • Author

Thanks so much!

This, as usual on this forum, has been a real good learning experience.

Edited by Guest

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.