Script issue on my MacBook Air with macOS Sequoia 15.6.1
I am using a macbook air with OS15.6.1
I use a software called Chronosync to sync my laptop to an external HDD (G-Drive 6TB). The HDD is plugged directly in the macbook's USB C port but I keep it unmounted (ejected) so that it will not spin unnecessarily when I am not using it.
I set up a script to use in Chronosync that will mount the G-Drive before the synchronizing begins and then eject it when the synchronizing ends. I am attaching screenshots of those scripts and one of the Terminal window showing "diskutil list".
If I use the disk number in the scripts (i.e., "diskutil mountDisk /dev/disk5"), the scripts work perfectly. disk5 for mounting and disk4 for ejecting. However, mac OS will change the disk number from time to time and then the script won't work.
I understood that I should be able to replace the HDD disk number with the HDD disk name so it will work regardless of the disk number, which I tried, but it did not work. I am attaching screenshots of those scripts as well.
Can anyone help me set up a proper script that will work with any disk number?
Thank you.
[Edited by Moderator]
Original Title: Apple script issue
MacBook Air 15″, macOS 15.6