Page 1 of 1

Check if app is running, drive mounted

PostPosted: Thu Aug 01, 2019 9:59 pm
by Radjin
I use an AppleScript in Indigo that checks if an app is running, if not, it checks if a drive is mounted and if so starts the app. If the drive is not mounted it attempts to mount the drive, checks if it is mounted and starts the app. If I understand correctly this will stop working on the next version of indigo. Is there a python equivalent.


Background:

I have two apps that each require a specific external drive to be mounted to work. It is very rare that either drive does not mount automatically at startup however it has happened. So I created the AppleScript to check for me. It also starts the apps for me after the indigo server starts and checks periodically.

The first app is iTunes and it’s drive is iTunes

The second app is SecuritySpy and it’s drive is Cameras.

Re: Check if app is running, drive mounted

PostPosted: Fri Aug 02, 2019 5:54 am
by agame
the Mac apps / Mac disks plugins can do this btw.

Re: Check if app is running, drive mounted

PostPosted: Fri Aug 02, 2019 8:00 am
by Radjin
AWSOME!!! Thanks for that.

I got it all working except being able to mount my NAS . I can see the status and unmount the NAS through the plugin but cannot mount. I tried both the mount (get an error) and the open (no error, just does not mount) commands.

Re: Check if app is running, drive mounted

PostPosted: Fri Aug 02, 2019 9:27 am
by jay (support)
FYI, as we've described elsewhere, AppleScripts that don't target Indigo will still work (as external scripts only).

How do you mount your NAS from AppleScript?

Re: Check if app is running, drive mounted

PostPosted: Fri Aug 02, 2019 10:07 am
by Radjin
Right now calling a bash script mounting the smb:/. I know this will continue to work, just wondering why the plugin fails to mount the share.

Re: Check if app is running, drive mounted

PostPosted: Fri Aug 02, 2019 11:23 am
by jay (support)
Don't know about the plugin.