Run script from URL

I'm opening a file from URL. Works fine. When I try to add the script portion, I get an error message saying I don't have enough privileges.

I made sure the calling script and the called script have full access privileges.

Then playing with the debugger, I discovered that the issue occurs during a script that is triggered onFirstWindowOpen for that file.

Is there anyway to prevent this unwanted script cascade?

The issue might still be in the way I am calling the script because when I run it from the file, it did not take the variable.

Is there something wrong with my syntax?

?script=ListSUB_CreateAccount&$$NewAccount=jane

I discovered that I still need to select extended privileges (run scripts from url) for the full access account I am using.

2 Likes

I'm back with my script trigger issue.

Now that the run scripts from url is activated. I get cannot find script or it has been deleted. A search on community confirmed that triggers will do that to run from urls...

So I guess I'm gonna use a normal perform script.

Hi @Cecile

I was pretty certain that in the past, I successfully used a FMP URL to trigger a script in a file that had an OnFirstWindowOpen script handler. To be fair, in most cases that I have used the FMP URL to trigger a script, the target file was already open, and thus the OFWO trigger probably did not come into play. But, I do seem to recall that I had one use case where I actually needed the OFWO script trigger to run, and it did so without issue.

Wondering if you could please share a link to the Community page that describes the issue, so that I can familiarize myself with what it says?

Also, wondering if you were able to confirm that the script trigger is the issue in the solution that you are working with (presumably by temporarily disabling the first-window trigger to confirm that it works when the script trigger is disabled)?

I did try to disable the OFWO but it still gave me the error. I looked with Show Window and can see that 3 files are also open though hidden when that file opens. Given that the solution has a whole lot of files and given the complexity, I pretty much have given up on using this method.

Moreover the FM URL method poses security risks. Especially because the account name and pwd are sent in clear. I was going through a very convoluted method to set a temporary pwd for the full access account and resetting it after the process. I was only using this method because I though it wasn't possible to open a file using a variable.

In the end I am using the Perform Script because I just learned that contrary to my holes-ridden understanding of FileMaker, it is possible to set the file to open using a variable. I thought I was limited to hard coded file names. I had not realized that I could set a FilePath which is a $$variable by setting it through "Manage Data Sources" at the bottom of the file list choices that pop up when you try to select the file to open.

2 Likes