I’m trying to get a remotely mounted drive to nicely unmount or eject. Building through AppleScript within Xcode, the drive will eject, but only after getting the beachball for 10 seconds or so.
If I run this script from Script Editor, the disk ejects immediately.
tell application “Finder”
eject disk “ibLibrary-HD1”
end tell
try to use the shell command diskutil unmount but the fastest methods are the
low level functions FSEjectVolumeSync() and FSUnmountVolumeSync() from CoreService’s File Manager
The diskutil unmount unfortunately did not work. It’s odd that I can unmount the drive through the Finder, TerminaI, & Script Editor, but not AppleScript in Xcode. I don’t know enough about Xcode to use that FSEjectVolumeSync() code. I really appreciate your help. Thanks