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

How to run a script from another file without showing login dialog?

Featured Replies

Hello,

I'm creating a "mailer" file to send HTML emails from FileMaker without the need for a third-party plugin.  The idea is that whenever another FM app needs to send an email, it can just ball up some JSON and call the "Send Mail" script from the central mailer file with the JSON as the script parameter.

I've read that if the same credential set exists for the logged-in user in both files, opening the secondary file will be transparent.  However, if not, the user is presented with a login dialog.  Since the "Open File" script step is not supported on WebDirect, I can't just detect if the file is open (via the DatabaseNames function) and have the script log in.  Using PSOS still shows the dialog.

Is there any way to run a script from another FM file without the user seeing a login dialog and without needing to duplicate user accounts in the second file?

  • Author

Hi comment,

The URL call looks like it would do what I want, but I can't seem to make it go.  I keep getting Error 5: "Command is invalid (for example, a Set Field script step does not have a calculation specified)"

My script step looks like: Insert from URL [With dialog: Off ; Target: $result ; "fmp://my.server.name/HelloTest?script=SayHello" ; Do not automatically encode URL ]

I started with my intended final use, and kept simplifying things when it didn't work.  I have made a simple file (HelloTest) that uses the Guest account, to eliminate possible hangups with login, etc.  I made sure to add the "fmurlscript" extended privilege.  The "SayHello" script just shows a custom dialog.

I tried using the IP address instead of DNS name of the server, with and without the script parameter, etc.  Still only getting Error Code 5.

I found a Google result that said Error 5 used to be a problem with the Insert from URL script step, but that it was fixed in FMS 21.1.1.  I am running FMS 21.1.1.40, so that shouldn't be a problem.  Also, I have several other places where I use Insert from URL to call an API, and they work just fine.  Maybe it's the "fmp://" protocol?  FMPro is not installed on the server, so maybe that protocol isn't registered and causing it to barf.  But it should work when trying to debug locally . . .  🤷‍♂️

You cannot use the Insert from URL script step for this because it supports only a limited set of protocols and the fmp:// URL scheme is not among them.

You should be able to use the Open URL script step.

 

  • 2 weeks later...
  • Author

I did get the fmp:// scheme to work using the Open URL script step.  Wasn't even aware of that one.  I thought Insert from URL was the only way to use cURL.  Turned out not to be the behavior I was after, though.

The Data API is just the ticket.  Took a bit to get the hang of, but it works!

Thank you for your help!

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.