I'd like to mount a volume and then immediately open a Finder window to a specific path but I'm having trouble converting from Apple Script to JXA.
I want the JXA equivalent of something like this:
tell application "Finder"
if not (disk "Airport Time Capsule" exists) then
mount volume "afp://AirPort%20Time%20Capsule._afpovertcp._tcp.local"
end if
open "/Volumes/Airport Time Capsule"
end tell
I've tried a few things but nothing seems to work. Complete documentation for JXA is non-existent.
var finder = Application('Finder');
finder.mount('afp://.....'); // doesn't work
finder.mount.volume('afp://.....'); // doesn't work
finder.mountVolume('afp://.....'); // doesn't work