# [メタ情報] # 識別子: Finderのギャラリー表示と標準表示を切り替える_exe # 補足: # [/メタ情報] 要約: このAppleScriptは、前面のFinderウィンドウの表示設定をカスタマイズするためのものです。スクリプトが実行されると、まずFinderウィンドウが存在しない場合は新規作成します。次に、ツールバー、パスバー、ステータスバーを非表示にします。さらに、System Eventsを通じてメニュー操作を行い、表示形式を「ギャラリー」に切り替え、タブバーとプレビューを非表示にします。また、グループ表示を「なし」に設定し、項目をファイル名順(「名前」)でソートします。これにより、余分な情報を排除し、コンテンツに集中できるクリーンな表示環境を自動で構築することを目的としています。 /Applications/自作appleスクリプト/ギャラリーとバー類非表示.scpt AppleScript ``` -- 前面の Finder ウィンドウを -- ギャラリー表示 + 各バー非表示 + ファイル名順にソート tell application "Finder" activate if (count of Finder windows) = 0 then make new Finder window end if set theWindow to front Finder window -- ツールバー / パスバー / ステータスバーを非表示 tell theWindow set toolbar visible to false set statusbar visible to false set pathbar visible to false end tell end tell -- メニュー操作で ギャラリー表示 / タブバー非表示 / プレビュー非表示 / 名前順ソート tell application "System Events" tell process "Finder" if exists menu bar 1 then tell menu bar 1 -- ▼ ギャラリー表示に切り替え tell menu bar item "表示" tell menu 1 if exists menu item "ギャラリーとして表示" then click menu item "ギャラリーとして表示" else if exists menu item "ギャラリー" then click menu item "ギャラリー" end if end tell end tell -- ▼ タブバー非表示 tell menu bar item "表示" tell menu 1 if exists menu item "タブバーを非表示" then click menu item "タブバーを非表示" end if end tell end tell -- ▼ プレビュー非表示 tell menu bar item "表示" tell menu 1 if exists menu item "プレビューを非表示" then click menu item "プレビューを非表示" end if end tell end tell -- ▼ グループ表示を「なし」にする(種類ごと等にまとまるのを防ぐ) tell menu bar item "表示" tell menu 1 if exists menu item "グループ表示" then tell menu item "グループ表示" tell menu 1 if exists menu item "なし" then click menu item "なし" end if end tell end tell end if end tell end tell -- ▼ ファイル名順でソート(表示順序 または 整頓順序 → 名前) tell menu bar item "表示" tell menu 1 if exists menu item "表示順序" then tell menu item "表示順序" tell menu 1 if exists menu item "名前" then click menu item "名前" end if end tell end tell else if exists menu item "整頓順序" then tell menu item "整頓順序" tell menu 1 if exists menu item "名前" then click menu item "名前" end if end tell end tell end if end tell end tell end tell end if end tell end tell ```