Python Forum
Avoid FreeFileSync from being launch while it has previous popups openned
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Avoid FreeFileSync from being launch while it has previous popups openned
#1
For those familiered with FreeFileSync, know that there is another feature called RealTimeSync(RTS), who simply doesnt work at least in my MacOS, so I start making my own "RealTimeSync" but seems like I am not able to control FreeFileSync launchs when a popup is launched, after the sleep time it continues popuping up and doesnt wait for a click on this first popup. I have also tried to use my own warnings instead of FreeFileSync(FFS) popups but I cannot rely on that.

For default those batchs from FFS and RTS, I can only launch those directly with 'open' command, since both have extended attributes.

So do you have a way to show it one at a time? Huh

This is the code that I am using right now, for testing:

import os
import sys
import subprocess
import time

####EDIT HERE####
ffs_batch_folder_path = '/Users/admin/Desktop/AOI-A/RTS_Config/'
ffs_batch_file = 'BatchRun_aoi2.ffs_batch'
nas_folder_path = 'Download'
#################

sleep_period = 60 #in seconds
first_launch_sleep_period = 30 #in seconds

def run_ffs_batch():
    #give some time to connect remote folder where it will sync
    time.sleep(first_launch_sleep_period)
    #starts periodic function
    while(1):
        print ('%s' %output)
        if os.path.exists('/Volumes/%s' %nas_folder_path):
            if os.path.exists('%s' %ffs_batch_folder_path):
                if len(output)>400:
                    print ('Connected from remote folder')
                    try:
                        #run batch file
                        subprocess.check_output(['open', "%s" %ffs_batch_file], cwd=ffs_batch_folder_path)
                    except subprocess.CalledProcessError as e:
                        print ('Unable to sync, check batch file name and location: \n%s' %e)
                else:
                    break
                    ap = """ display dialog "Remote folder not accessible, please contact your system administrator!" with title "Warning from Remote Folder!" with icon caution buttons {"OK"} """
                    subprocess.call("osascript -e '{}'".format(ap),shell=True)
                    print ('Remote folder not accessible!')
            else:
                ap = """ display dialog "Localhost folder not accessible, please contact your system administrator!" with title "Warning from Localhost Folder!" with icon caution buttons {"OK"} """
                subprocess.call("osascript -e '{}'".format(ap),shell=True)
                print ('Localhost folder not accessible!')
        else:
            ap = """ display dialog "Remote folder not mounted, please contact your system administrator!" with title "Warning from Remote Folder!" with icon caution buttons {"OK"} """
            subprocess.call("osascript -e '{}'".format(ap),shell=True)
            print ('Remote folder not mounted!')
        #sync period of time
        time.sleep(sleep_period)
 
if __name__=="__main__":
    run_ffs_batch()
Reply
#2
I avoid those popups by removing those through FreeFileSync GUI, and also I made a search to see if FreeFileSync was still being used through PID to avoid this app to be openned again,while the other one was running, and creating a stack of FreeFileSync processes.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Launch Python IDLE Shell from terminal Pavel_47 5 1,212 Feb-17-2023, 02:53 PM
Last Post: Pavel_47
  Launch Windows Application OEMS1 0 2,116 Mar-26-2021, 07:42 PM
Last Post: OEMS1
Photo Python won`t launch error newbieee 0 1,755 Feb-02-2021, 11:51 PM
Last Post: newbieee
  Launch another python command without waiting for a return. SpongeB0B 13 10,899 Jun-18-2020, 10:45 AM
Last Post: Yoriz
  error message on program launch DJPY1175 0 1,739 Jun-10-2019, 08:40 AM
Last Post: DJPY1175
  [split] Python won't launch Nikmartin 1 2,309 May-12-2019, 11:58 PM
Last Post: micseydel
  Pyinstaller exe won't launch after crash kainev 0 2,610 May-11-2019, 06:06 PM
Last Post: kainev
  How to launch a program through python script - Mac OS Mojave Aurimas 2 2,810 May-11-2019, 10:20 AM
Last Post: kritesh
  launch .exe from python script in windows hary 8 59,530 Mar-21-2017, 10:25 AM
Last Post: Ofnuts
  Launch.json isn't working RemyLeBleau 5 6,528 Mar-16-2017, 09:37 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020