Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

garyleecn

macrumors 6502a
Original poster
Jul 25, 2014
841
142
so since we finally received our LG displays, problem/challenges comes up

one that I noticed right away is that even if connected to LG 5k display, sometimes the audio input/output source is still set to be the internal mic/speaker.

so is it possible to write an AppleScript or automator to switch those to LG, if the script/automator can be triggered automatically by the connection, it would be even better.


as for disconnecting, I have a script/alfred workflow that quits all applications that is accessing data on external hard drives (those connected on the display, not computer), and eject all external drives for a safer disconnect. if you want I can share it
 
so since we finally received our LG displays, problem/challenges comes up

one that I noticed right away is that even if connected to LG 5k display, sometimes the audio input/output source is still set to be the internal mic/speaker.

so is it possible to write an AppleScript or automator to switch those to LG, if the script/automator can be triggered automatically by the connection, it would be even better.


as for disconnecting, I have a script/alfred workflow that quits all applications that is accessing data on external hard drives (those connected on the display, not computer), and eject all external drives for a safer disconnect. if you want I can share it

that would be great if you can share. I also have 3 hard drives connected to the monitor, but I haven't come across switching to the internal speakers by itself. However, I do notice that when I do facetime, the camera always defaults back to the internal which isn't a big deal but when I have it in clamshell mode, it is a big deal.
 
looks like the forum doesn't allow file upload, so if you are using Alfred, there is a workflow called ejectall you can download from their forum.
if not, you can create a automator application, with only two steps.


1. run shell script, with the following

# unmount all external drives from your osx
killall -9 Photos
for disk in $(diskutil list|grep external|sed -e 's/^\([^ ]*\) .*$/\1/g'); do diskutil unmountDisk force $disk; done

the second line is to force quit photos app, because I run my photo library on the external drive. you can modify it as fit your situation.

2. Display notification
and put down what every text you want. this is just to let you know the workflow is finished, and it's safe to unplug now.
so I just wrote 'safe to disconnect now'


hope it helps

that would be great if you can share. I also have 3 hard drives connected to the monitor, but I haven't come across switching to the internal speakers by itself. However, I do notice that when I do facetime, the camera always defaults back to the internal which isn't a big deal but when I have it in clamshell mode, it is a big deal.
 
looks like the forum doesn't allow file upload, so if you are using Alfred, there is a workflow called ejectall you can download from their forum.
if not, you can create a automator application, with only two steps.


1. run shell script, with the following

# unmount all external drives from your osx
killall -9 Photos
for disk in $(diskutil list|grep external|sed -e 's/^\([^ ]*\) .*$/\1/g'); do diskutil unmountDisk force $disk; done

the second line is to force quit photos app, because I run my photo library on the external drive. you can modify it as fit your situation.

2. Display notification
and put down what every text you want. this is just to let you know the workflow is finished, and it's safe to unplug now.
so I just wrote 'safe to disconnect now'


hope it helps
appreciate it!
 
so is it possible to write an AppleScript or automator to switch those to LG, if the script/automator can be triggered automatically by the connection, it would be even better.
Some time ago I tried to do the same to toggle Bluetooth power whenever I connect the external display.
AFAIK in AppleScript there is no event triggered by connecting new display, so this was a no-go.
as for disconnecting, I have a script/alfred workflow that quits all applications that is accessing data on external hard drives (those connected on the display, not computer), and eject all external drives for a safer disconnect.
I use Mountain for that exact purpose.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.