0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【AppleScript】MacからeGPUと外付けHDDを一気に取り外す

Last updated at Posted at 2020-04-05

やりたいこと

家でeGPUや外付けHDDを繋いで使っているMacを持ち出す際、そのままケーブルを引っこ抜くと警告が出るので、ちゃんと取り外しの操作をしてからケーブルを抜きたい。

方法

on run
	tell the application "Finder" to eject (every disk whose ejectable is true)
	do shell script "/usr/bin/SafeEjectGPU Eject"
end run

2行目でHDD類の取り外し、3行目でeGPUの取り外しを行っています。
あとはそのまま.app化(ファイル-書き出す でファイルフォーマットにアプリケーションを選択)するなり、Automatorでサービス化してショートカットキーを割り当てるなり、ご自由に。

参考

簡単にMacから全てのディスクを取り外す
Proper way to disconnect eGPU through scripting |Apple Developer Forums

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?