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.

Run a script based on field contents

Featured Replies

Here is a tough one!

I would like to run a script based on the value of a field

ie: Fieldx = happy

Instead of using if statement in my script such as

if fieldx=happy

perform script happy

end if

if fieldx=sad

perform script sad

end if

i would prefer to bypass the if statement and

perform script (value)fieldx

is this possible?

Stu

Wouldn't that be nice? Unfortunately, scripts must be explicitly called.

Sad, but true - present versions of FileMaker don't provide a way to use field values to directly determine which script is to be run, but require you to do the hard slog of building up your own selection procedure using a nest of If[ ] steps.

But as Queue has observed, the feature you're looking for would be nice - so I'd encourage you not to let it rest there, but to pay a visit to the FMI feature request page and suggest that it be included in a future version. The URL for requests of this kind is:

http://www.filemaker.com/company/product_feature_request.html

I've already done so myself, but if enough folks make the suggestion, you just might see it in a future version. wink.gif

I would like to run a script based on the value of a field

ie: Fieldx = happy

is this possible?

No prob with applescript.

copy cell "WhichScript" of current record to whichScript

do script FileMaker script whichscript

It's also possible using the shell script plugin to do this automatically just entering a value in a field.

  • Author

Im running in a windows enviroment.. Is there a shell script plugin for windows?

I have writen a vb add-on program called Dynascript that can do this, as it was a nesesity for a project. Email me if you are interested.

Charles

  • Author

If anyone is interested I figured it out using the Troi Activator Plugin.. Following is the two line script

External("Actr-StartListener", "54242" & "|" & Status( CurrentFileName) & "|xxxxxx")

External("Actr-SendRemoteEvent","54242" & "|" &External("Actr-GetIPAddress", "")& "|" &"xxxxxx" & "|" &Status( CurrentFileName) & "|" & act_Script_to_run & "|" & "" & "|" & "")

Thanks for the feedback

Stu

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.