Jump to content

Suppressing "Open New or Existing File" dialog


This topic is 3417 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

 
Link to comment
Share on other sites

  • 1 year later...

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

Link to comment
Share on other sites

This topic is 3417 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.