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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By JH Howland
      Filemaker Pro 11 is running on two Windows 10 computers connected as Host and Client over a network.
      The script to import data from an Excel .csv file utilizes the following script step options:
          1. Un-Checked - Specify data source - File
          2. Check - Specify import order, Import Action
              a. Select - Update existing records in found set
              b. Check - Don't import first record (contains field names)
          3. Check - Perform without dialog
      When the Import script is run from the Host computer, and the desired .csv file is manually selected, the Excel first row field names are not imported and the second row with the data is imported as expected. (See Host Import Mapping)
      When the same script is run from the Client computer, the Excel first row field names are imported and not the second row data.  To get the proper result, I have to leave the check box for "Perform without dialog" unchecked and then manually, from the "Import Action" group, check the box for "Don't import first record (contains field names)" to get the proper data imported. (See Client Import Mapping, check box is no longer checked)
      Is this caused by a defect in FMP 11?  I can't figure out why this is happening.


    • By JH Howland
      After my Windows 10 based Filemaker Pro 11 MarinaPro Solution is launched (Path = C:/MarinaPro/Marina.fp7), I need to create a variable ($$source = filewin:/C:/MarinaPro/ResScheduler/) to a revised default "Open File" path.  Because I need to select from several reservation request attachment Excel .csv files, placed in the ResScheduler directory by an Outlook 2010 Macro, my "Import Records" script is set with an "unspecified" data source.
      When my script is activated with Error Capture "Off", I get the obligatory Filemaker Pro Error message, "The file <unknown> could not be found..." and the "Open File window is still set to "Look in: "MarinaPro" (Default).  And, of course with Error Capture "On" there is no Open File window presented.
      I have to manually select and import the first Excel.csv file before the default directory becomes "ResScheduler".
      I want my default "Open File" "Look in:" directory changed from "MarinaPro" to "ResScheduler" before I open the first Excel.csv file.
      Is there a way, nothing I have tried is working.
      Import.pdf
    • By transpower
      I've updated my computer from Windows 7 Pro to Windows 10 Pro.  My FileMaker Pro Advanced 11 does not launch.  I get the message "The application has failed to start because its side-by-side configuration is incorrect."  What's the solution for this issue?
      Update:  I clicked on an fp7 file, and then Windows asked me to insert the FileMaker CD, which I did.  Some files were quickly copied over, and everything works fine now!
       
    • 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?
  • Who Viewed the Topic

    4 members have viewed this topic:
    Terrible Toll  D Rai  scain101  JerrySalem 
×
×
  • Create New...

Important Information

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