November 14, 201312 yr Using FMP12, I was trying to use applescript to launch FMP and and a remote file.. I got it to work except for the fact that the "Open New or Existing File" dialog box pops up and stops the script.. The checkbox to disable the dialog is gone now (Please bring it back!!), so anyone know a way to use applescript to "Cancel" the dialog? Also, just for Reference sake, it took me awhile to get the applescript syntax correct to remotely launch a database file: This actually terminates the FM process the tries to open a remote database that on startup runs a script. set app_name to "FileMaker Pro" set the_pid to (do shell script "ps ax | grep " & (quoted form of app_name) & " | grep -v grep | awk '{print $1}'") if the_pid is not "" then do shell script ("kill -9 " & the_pid) delay 10 tell application "FMPro" activate delay 10 getURL "Fmp://username:password@ipaddress/filename.fmp12" end tell
November 15, 201312 yr If you rewrite your routine to open the FM FILE instead of the app, this dialog will not present itself. Much the same as clicking on a file automatically opens the FM app.
November 18, 201411 yr Just in case anyone runs into this, here's my solution. First check to see if GUI Scripting is enabled tell application "System Events" set UI_enabled to UI elements enabled" end tell Then launch and activate FileMaker Pro. I'm calling it from osascript, so "activate" by itself doesn't seem to cut it. tell application "FileMaker Pro Advanced" launch activate end tell Use GUI Scripting to click the "Cancel" button of window "Open New or Existing File" tell application "System Events" tell process "FileMaker Pro Advanced" click button "Cancel" of window "Open New or Existing File" end tell end tell Finally open the URL tell application "FileMaker Pro Advanced" getURL "fmp://FMP_USER:FMP_PASSWORD@FMP_HOST/FMP_DATABASE" end tell Cheers, jp
Create an account or sign in to comment