This topic is 2577 days old. Please don't post here. Open a new topic instead.
Our company is switching to VPN for remote users to to connect to our FMS-hosted databases. So I want to incorporate connecting to VPN into our already established procedure for accessing those databases via a FileMaker script.
Our VPN connection is up and running. And I found an AppleScript that works well making and continually checking the VPN connection. But I don't know enough about AppleScripts and how they apply to FileMaker scripts to make it work. From what I could find on the subject, I need to modify the AppleScript steps to work in FileMaker; such as adding a \ in front of each double-quote. But, apparently that's not all.
Here is the raw AppleScript code:
tell application "System Events"
tell current location of network preferences
set myVPN to the service "VPN NAME"
if myVPN is not null then
if current configuration of myVPN is not connected then
And here's what I did: I created a new FileMaker script and added one step - Perform AppleScript. In the step options, I selected Native AppleScript and entered the above code. (Using Calculated AppleScript didn't appear to be the right choice for this method.) I saved the script and tried running it, but nothing happens. No errors, nothing. From what I was able to find on the subject, I assumed the problem lies with how the AppleScript text is formatted in the script description. But, nothing I tried worked. Can someone show me what needs to be done with the above AppleScript to make it work in a FileMaker script?
One major issue may be the restriction: "Indenting of repeat loops and conditional statements is not supported." This may limit me to stripping the AppleScript down to just the connect VPN portion. But, I really liked what the AppleScript offered in the way of checking regularly to make sure the connection is still active and to re-connect if it isn't. So, if there is another way to do this, I'm all ears.
Finally, just in case there is a better method for all of this that I am just not aware of, here is the "big picture": My remote users each have a small database file they open every day to access our FMS Server-hosted databases. The file contains one button which activates a script that opens the required databases. Switching to VPN simply meant setting up the VPN connection on each computer and changing the External Data Sources in the local database. What I hoped to do is to modify the script so that it first makes the VPN connection and then, once that's completed, opens the databases. An alternative process might be to create a separate script to make the VPN connection and that script could be set up as a Script Trigger which activates when FileMaker is first started up or the file is first opened.
Just to complicate matters, I also need a similar FileMaker script that will connect to VPN on a Windows 8 machine - which, of course, precludes using AppleScript.