AnsweredAssumed Answered

Perform external script

Question asked by fabino on Sep 20, 2018
Latest reply on Sep 21, 2018 by fabino



I have spent about a day trying to understand what was going wrong but I am still confused.


I am on FMP Adv 16, on OS X 10.13.6, I have created a script that:


- uses the step "Insert File" to save the Path of a user selected external filemaker file into the variable $Path

- sets the global var $$Path to the value of "GetValue ( $Path; 2 ) "

- opens the selected file with "Open File" set to use a named external source that has the value of $$Path

- now I am trying to execute a script located inside the file selected by the user

- "Perform Script" command that is assigned to the named external source that has value $$Path.


In this way I cannot see the name of the script I want to use. So I have temporary added one external file to the same named external data source, just before $$Path.

In this way I am able to see all scripts of external file and select the script name I need.

Then I save the script and then I go to the manage external data sources panel and I do remove the real file reference in my named  external data source. I leave $$Path only there.


Is this procedure correct?


It happens that next time I open my FM solution, when I go to edit the same script again, the script name is now wrong or sometimes set to "unknow" but it seems to work: when I run it, the right script is opened from remote file.


Are things so "complicated" and confused?


Is there any better way? Should I leave a real external file model just AFTER the $$Path in the External data source list just to see the right script?


How does Filemaker search for the script in the external file? Does it search for the same name or any kind of internal Script Id?


What happens if there are two scripts with the same name in different subfolders?