こんにちは、コンスキです。
他の人にパソコン画面を見せる時に、デスクトップにあるファイルを非表示にしたいときってありませんか?
ターミナルからコマンドを打つとできます。
しかし、とっさに非表示にしたい時にそんなことをしている暇はありませんよね…
そこで今回は、ショートカットキーを押すだけで、表示非表示を切り替えられるようにする方法を紹介します。
動作の例
僕は「control + D」を押すことで、次のように切り替えられるようにしています。
Automatorの設定
1. Launchpad(アプリ一覧的なやつ)を開き「Automator」で検索し、表示されたアプリを起動
![](https://konsuki.com/wp-content/uploads/2021/10/image-175-1024x602.png)
2. 「ファイル > 新規」を選択
![](https://konsuki.com/wp-content/uploads/2021/10/image-176.png)
3.「クイックアクション」を選択
![](https://konsuki.com/wp-content/uploads/2021/10/image-179-1024x843.png)
4.ワークフローが受け取る項目を「入力なし」に変更
![](https://konsuki.com/wp-content/uploads/2021/10/image-212.png)
5.検索欄に「シェル」と入力
![](https://konsuki.com/wp-content/uploads/2021/10/image-224-1024x659.png)
6.「シェルスクリプトを実行」をダブルクリック
![](https://konsuki.com/wp-content/uploads/2021/10/image-225-1024x657.png)
7.画像で示す枠の中に下のスクリプトをコピペ
![](https://konsuki.com/wp-content/uploads/2021/10/image-226-1024x560.png)
▼コピペするスクリプトはこちらです
ICON_STATUS=`defaults read com.apple.finder CreateDesktop`
if [ $ICON_STATUS -eq 0 ]
then
NEW_STATUS=true
else
NEW_STATUS=false
fi
defaults write com.apple.finder CreateDesktop -boolean $NEW_STATUS
killall Finder
8.「Cmd + S」を押し、「デスクトップファイルの表示/非表示」と入力後、保存する
![](https://konsuki.com/wp-content/uploads/2021/10/image-227-1024x845.png)
ショートカットキーの設定
1.「アップルマーク > システム環境設定」のように選択
![](https://konsuki.com/wp-content/uploads/2021/10/image-191-1024x641.png)
2.「キーボード」を選択します。
![](https://konsuki.com/wp-content/uploads/2021/10/image-192-1024x867.png)
3.「ショートカット」タブを選択
![](https://konsuki.com/wp-content/uploads/2021/10/image-193-1024x563.png)
4. 「サービス」を選択
![](https://konsuki.com/wp-content/uploads/2021/10/image-194-1024x730.png)
5.先ほど作成した「デスクトップファイルの表示/非表示」を見つけ、チェックをつけた後クリック
![](https://konsuki.com/wp-content/uploads/2021/10/image-229-1024x912.png)
名前が長かったり、記号が使われていると全く同じように表示されないことがあります。
例:デスクトップファイルの表示非表示 ▶︎ デスクトップ…の表示:非表示
6.「ショートカットを追加」をクリック
![](https://konsuki.com/wp-content/uploads/2021/10/image-230.png)
6.好きなショートカットキーを入力(例:control + D)
![](https://konsuki.com/wp-content/uploads/2021/10/image-231.png)
コメント