Jump to content
Sign in to follow this  
ggt667

Is there a way in AppleScript to trap if the connection is lost and have an AppleScript act on this?

Recommended Posts

Is there a way in AppleScript to trap if the connection is lost and have an AppleScript act on this?

At the risk of asking and answering myself( AppleScript below )

repeat
	tell application "FileMaker Pro"
		try
			database "db"
		on error
			do shell script "sudo shutdown -r now" with administrator privileges
		end try
	end tell
	delay 59 -- 59 secs
end repeat

 

Edited by ggt667

Share this post


Link to post
Share on other sites

This is a background script I use to make sure a server partition is always mounted.
We had irregular diconnects and this will reconnect the drive within a 10 minute time frame.
This is meant for a very 'low' use computer running background apps.

;-)

Mountdisk.jpg.1b91f7a3deb9a2242b0f0002de4ebf39.jpg

Edited by CoZiMan
notify

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

  • Similar Content

    • By JH Howland
      I have several customers that utilize our MarinaPro Marina Dockage Management solution.  All are running Windows 10 Pro 64Bit and Filemaker Pro 11.0v2.
      All the MarinaPro solutions are functioning well with exception to the one marina that is using an HP LaserJet Professional M1217nfw MFP printer.  The printer has been named "HP LaserJet".
      The problem is that scripted reports will not print after an updated/revised solution is installed on the computer.  However, a test page can be printed from the Windows default printer.
      Print scripts are utilized by more than one report and this sample is named -  "Master Portrait Printer | Current Record | All | 1 |" and is formatted as:
      #Used by: Print Float Plan Form
      #Used by: Toggle Printer Mode
      #Portrait Orientation
      #Print: Current Record | Print Range All | Copies: 1
      Print [Restore: HP LaserJet; No dialog]
      Filemaker Help states, "If you do not specify an output destination before saving the script or 'if the specified printer cannot be found' when the script executes, the 'output from the script step is sent to the user’s default' printer."
      It appears that the "specified" printer is not being found and the output from the script is "not" being sent to the user's default printer.
      However, if I "re-specify print options" and "Save" the script it will start working again.  And now I am unclear whether it is actually finding the FMP "specified" printer or the Windows "default" printer.
      Any ideas why this occurs?
       
    • By JH Howland
      In Filemaker Pro Advanced 11 ( and 14 ), is it possible to launch the Windows 10 Mail program (WinMail.exe.mui) using the Filemaker "Send event" or some other approach?
    • By wedgeman
      We are working on a process for passing certain info nuggets out of a solution (FMP 13) in an encrypted method.
      For various reasons a version upgrade isn't feasible. So the plan is to encrypt the nuggets, then pass them into a format for transport.
      Currently, we're using Applescript to pass the particular fields into an AES-256-CBC encryption process in a calculated Applescript step, as follows :
       
       
      The problems which concern me here:
      1. The password is "traveling" into Terminal in plaintext.   Is there a way this can be viewed during the process (a 'ps' or some other method)??
      2. Is there a better method to accomplish this without running as an echo?
       
      I've tried various flavors of this process (successful encryption & transport, etc), but am most concerned about the potential vulnerability from within OSX.. I've run various flavors, then attempted to grep for any of the password strings in log files and Library/Application Support/ folders, but haven't found anything...
      Is this an unfounded issue, or should I be going a different direction?
    • By fed
      I just upgraded to FMP16 from FMP13.  My applescripts no longer work.  I get an error of -10004, for which I cannot find an explanation.
      Any idea what I must change to make Applescripts work in FMP16?
    • By typewriter
      Is it possible to use AppleScript to open the Script Workplace, select a particular script and even scroll to a particular line?
      I looked through several AppleScript sources (there are not so many...) as well as the Dictionary of FIleMaker Pro Advanced 15, but all examples seem to deal with using the database (i.e. finding and manipulating records), not authoring.
      Why would be handy? I have an authoring database where I can store the scripts and scriptsteps of a solution. These are converted from FIlemaker XML using the MBS plugin, not that complicated. Then it's possible to select the scriptsteps that need attention. But locating these scripts in the original solution is quite time consuming, so an AppleScript would save me tons of time.
       
       
  • Who Viewed the Topic

    1 member has viewed this topic:
    hutchlad 
×

Important Information

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