Macとかの雑記帳

Finderを再起動し、不可視ファイルの表示/非表示を切り替えるApplescript製アプリです。専用のアプリやメンテナンスソフトを使えば同様のことができますが、毎回ウィンドウから選択するのが面倒だったので、以前自作した物です。操作はワンクリック、表示はGrowlのみのシンプルなものです。

不可視ファイルの表示/非表示を切り替えるアプリ

不可視ファイル用に作ったのですが、表示/非表示を切り替える際にFinderを再起動するので、再起動用で使ってます。自作した物の中ではメモリ解放の次に重宝してます。
  • 一回で切り替わってくれない時は、再度実行します。
  • Growlがうざい時は「Growl表示ここから~Growl表示ここまで」の間を消します。

 

property Hiddenfile : false
if Hiddenfile is false then
do shell script "defaults write com.apple.finder AppleShowAllFiles ON"
do shell script "killall Finder"
set Hiddenfile to true

###########Growl表示ここから▼###########
tell application "GrowlHelperApp"
set the allNotificationsList to
{"hidden files"}

set the enabledNotificationsList to
{"hidden files"}

register as application
"hidden files" all notifications allNotificationsList
default notifications enabledNotificationsList
icon of application "Finder"

notify with name
"hidden files" title
"Fainder notification" description
"不可視ファイルを表示します。" application name
"Growl AppleScript Sample" icon of application "Finder"
end tell
###########Growl表示ここまで▲###########

else
do shell script "defaults write com.apple.finder AppleShowAllFiles OFF"
do shell script "killall Finder"
set Hiddenfile to false

###########Growl表示ここから▼###########
tell application "GrowlHelperApp"

notify with name
"hidden files" title
"Fainder notification" description
"不可視ファイルを非表示にします。" application name
"Growl AppleScript Sample" icon of application "Finder"
end tell
###########Growl表示ここまで▲###########

end if

 

スポンサード リンク