マーリンアームズ サポート   翻訳   コンサル   講座   アプリ   コラム
JavaScript講座     辞書サイト

カンフーマック ── 猛獣を飼い慣らす310の技    キア・トーマス著    武舎広幸訳

コマンドおよびリンク一覧

本に登場したコマンドやリンク等の一覧です。 コマンドやプログラムはコピーして、ターミナルのウィンドウやAppleScriptエディタなどにペーストしてご利用ください。詳しくは付録Aを参照してください。

なお、コマンドは必ず本文の説明をお読みになってから実行してください。意味がわからず実行した場合、運が悪いとシステムの調子が悪くなる場合があります。

  1章 4章 5章 7章 8章 9章 10章 11章 12章 13章 14章 15章 16章 17章 18章 19章 20章 21章 22章

この本自体に関連するもの

1章 オールスター選抜チーム

#008

.mailtolocという拡張子を.maillocに変えるというワザが書かれているページ

#017

Apple ハードウェア製品のシリアル番号の調べ方
保証の確認

4章 メール(Mail)

#041

Introduction to AppleScript Overview

ページ先頭に戻る

5章 その他の標準アプリ

#061

tell application "TextEdit"
  set wc to count words of document 1
  set txt to "ワード"
  set result to (wc as string) & txt
  display dialog result with title "ワードカウント" buttons {"OK"} default button "OK"
end tell
tell application "TextEdit"
  set cc to count characters of document 1
  set txt to "文字"
  set result to (cc as string) & txt
  display dialog result with title "文字数" buttons {"OK"} default button "OK"
end tell

#063

defaults write com.apple.iCal "Default duration in minutes for new event" -int 30

defaults write com.apple.iCal "Default duration in minutes for new event" -int 15

defaults delete com.apple.iCal "Default duration in minutes for new event"
sudo chflags -h nohidden

XQuartz
MacPorts
Fink

#064

defaults write com.apple.iCal IncludeDebugMenu -int 1

defaults delete com.apple.iCal IncludeDebugMenu

7章 画像、サウンド、ムービー

#089

VLC

#093

choose color default color {65535, 65535, 65535}

#094

形式の指定
defaults write com.apple.screencapture type -string 〈ファイル形式〉
defaults write com.apple.screencapture type -string GIF
defaults delete com.apple.screencapture type
保存場所
defaults write com.apple.screencapture location /Users/XXX/Documents/
defaults delete com.apple.screencapture location
シャドウの削除
defaults write com.apple.screencapture disable-shadow -bool TRUE
defaults delete com.apple.screencapture disable-shadow

#098


#!/bin/bash
    osascript -e 'set volume with output muted'
#!/bin/bash
    osascript -e 'set volume without output muted'
sudo chmod u+x ~/Documents/mute.sh
sudo chmod u+x ~/Documents/unmute.sh
sudo mv ~/Documents/mute.sh /Library/Scripts/
sudo mv ~/Documents/unmute.sh /Library/Scripts/
sudo defaults write com.apple.loginwindow LogoutHook /Library/Scripts/mute.sh
sudo defaults write com.apple.loginwindow LoginHook /Library/Scripts/unmute.sh
sudo defaults delete com.apple.loginwindow LogoutHook
sudo defaults delete com.apple.loginwindow LoginHook
sudo rm -f /Library/Scripts/mute.sh  /Library/Scripts/unmute.sh

ページ先頭に戻る

8章 Dock

#108

defaults write com.apple.dock tilesize -int 8; killall Dock
defaults delete com.apple.dock tilesize; killall Dock

#109

defaults write com.apple.dock use-new-list-stack -bool TRUE; killall Dock
defaults delete com.apple.dock use-new-list-stack; killall Dock

#110

defaults write com.apple.dock scroll-to-open -bool TRUE; killall Dock
defaults delete com.apple.dock scroll-to-open; killall Dock

#111

defaults write com.apple.dock mouse-over-hilite-stack -bool TRUE; killall Dock
defaults delete com.apple.dock mouse-over-hilite-stack; killall Dock

#112

defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile";}'; killall Dock

#113

defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'; killall Dock
defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}'; killall Dock

#114

defaults write com.apple.dock no-glass -bool TRUE; killall Dock
defaults delete com.apple.dock no-glass; killall Dock
defaults write com.apple.Dock pinning start; killall Dock
defaults write com.apple.Dock pinning end; killall Dock
defaults delete com.apple.Dock pinning; killall Dock

#115

defaults write com.apple.Dock showhidden -bool TRUE; killall Dock
defaults delete com.apple.Dock showhidden; killall Dock

#116

defaults write com.apple.dock use-old-grid-animation -bool TRUE; killall Dock
defaults delete com.apple.dock use-old-grid-animation; killall Dock

#117

defaults write com.apple.dock static-only -bool TRUE; killall Dock
defaults delete com.apple.dock static-only; killall Dock

9章 Spotlight

#123

スマートフォルダに関する記述

#127

mdimport -r ~/Library/Spotlight/tarimporter.mdimporter/

Spotlightプラグインのページ
Tarimporter(Spotlightプラグイン)

#128

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
locate -i hosts
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.locate.plist

ページ先頭に戻る

10章 クイックルック

#133

qlmanage -p disneyland.jpg
qlmanage -p *.jpg

#134

defaults write com.apple.finder QLEnableTextSelection -bool TRUE; killall Finder
defaults delete com.apple.finder QLEnableTextSelection; killall Finder

#135

クイックルックのプラグインのページ

11章 ウインドウ

#146

defaults write com.apple.dock single-app -bool TRUE; killall Dock
defaults delete com.apple.dock single-app; killall Dock

#147

defaults write -g AppleMomentumScrollSupported -bool FALSE
defaults delete -g AppleMomentumScrollSupported

#148

defaults write -g NSNavPanelExpandedStateForSaveMode -bool TRUE
defaults delete -g NSNavPanelExpandedStateForSaveMode

#149

defaults write -g AppleEdgeResizeExteriorSize 10
defaults delete -g AppleEdgeResizeExteriorSize

アップルのDashboardウィジェットのページ

ページ先頭に戻る

12章 Mission Control、Launchpad、Dashboard

#150

defaults write com.apple.dock expose-cluster-scale -float 1; killall Dock
defaults delete com.apple.dock expose-cluster-scale; killall Dock

#153

sqlite3 ~/Library/Application\ Support/Dock/*.db "DELETE from apps; DELETE from groups WHERE title<>''; DELETE from items WHERE rowid>2;"
killall Dock
defaults write com.apple.dock ResetLaunchPad -bool TRUE; killall Dock

#155

数値を指定してください。
defaults write com.apple.dock springboard-blur-radius -int <0-255の数値>; killall Dock
defaults delete com.apple.dock springboard-blur-radius; killall Dock

#156

defaults write com.apple.dock workspaces-edge-delay -float 0; killall Dock
defaults write com.apple.dock workspaces-edge-delay -float 0.15; killall Dock
defaults delete com.apple.dock workspaces-edge-delay; killall Dock

#160

defaults write com.apple.dashboard devmode -bool TRUE; killall Dock
defaults delete com.apple.dashboard devmode; killall Dock

#161

Dock
defaults write com.apple.dock mcx-expose-disabled -bool TRUE; killall Dock
defaults delete com.apple.dock mcx-expose-disabled; killall Dock
Dashboard
defaults write com.apple.dashboard mcx-disabled -bool TRUE; killall Dock
defaults delete com.apple.dashboard mcx-disabled; killall Dock
Spotolight
sudo mdutil -a -i off
sudo mdutil -a -i on

13章 キーボード、マウス、トラックパッド

#169

Services Manager

14章 プリンタとディスプレイ

#179

defaults -currentHost write -g AppleFontSmoothing -int 2
defaults -currentHost delete -g AppleFontSmoothing

ページ先頭に戻る

15章 Finder

#188

アイコンが公開されているページ

#189

defaults write com.apple.finder _FXShowPosixPathInTitle -bool TRUE; killall Finder
defaults delete com.apple.finder _FXShowPosixPathInTitle; killall Finder

#190

defaults write com.apple.finder PathBarRootAtHome -bool TRUE; killall Finder
defaults delete com.apple.finder PathBarRootAtHome; killall Finder

#191

メインフォント
defaults write com.apple.finder NSSystemFont -string AmericanTypewriter; killall Finder
タイトルバー
defaults write com.apple.finder NSTitleBarFont -string ArialBlack; killall Finder
フォントサイズ
defaults write com.apple.finder NSTitleBarFontSize 16; killall Finder
defaults delete com.apple.finder NSSystemFont
defaults delete com.apple.finder NSTitleBarFont
defaults delete com.apple.finder NSTitleBarFontSize
killall Finder

#192

chflags nohidden ~/Library/
chflags hidden ~/Library/

#195

chflags hidden secret.doc
chflags nohidden secret.doc
隠しファイルを見る
defaults write com.apple.finder AppleShowAllFiles -bool TRUE; killall Finder
defaults delete com.apple.finder AppleShowAllFiles; killall Finder

#204

defaults write com.apple.finder CreateDesktop -bool FALSE; killall Finder
defaults delete com.apple.finder CreateDesktop; killall Finder
display dialog "Desktop icons visible or hidden?" buttons {"表示する", "隠す"} with icon 2 with title "Switch to presentation mode" default button 1
set switch to button returned of result
if switch is "隠す" then
  tell application "Terminal"
    do shell script "defaults write com.apple.finder CreateDesktop -bool FALSE; killall Finder"
  end tell
else
  tell application "Terminal"
    do shell script "defaults delete com.apple.finder CreateDesktop; killall Finder"
  end tell
end if

#211

defaults write com.apple.finder NSDraggingAutoscrollDelay -int 0; killall Finder
defaults delete com.apple.finder NSDraggingAutoscrollDelay; killall Finder

#212

defaults write com.apple.finder QuitMenuItem -bool TRUE; killall Finder
defaults delete com.apple.finder QuitMenuItem; killall Finder

#217

on open
  tell application "Finder"
    move selection to trash
  end tell
end open

16章 ネットワーク

#221

アップルのAirDropに関するページ

#223

ウィンドウズ機にマックから接続することができるクライアントソフト

#224

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
defaults delete com.apple.desktopservices DSDontWriteNetworkStores

#227

Apple IDの入手

#228

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist

#230

defaults write com.apple.NetworkBrowser BrowseAllInterfaces -int 1
defaults delete com.apple.NetworkBrowser BrowseAllInterfaces

ページ先頭に戻る

17章 Time Machineとセキュリティ

#233

sudo tmutil enablelocal
sudo tmutil snapshot
sudo tmutil disablelocal

#234

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 7200
sudo defaults delete /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval

#235

tmutil snapshot
tmutil startbackup
tmutil stopbackup
sudo tmutil disable
sudo tmutil enable

#236

defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool TRUE
defaults delete com.apple.TimeMachine DoNotOfferNewDisksForBackup

#241

TrueCryptのダウンロード
MacFuseの最新バーションのダウンロード(.dmgファイル)

#242

defaults write com.apple.LaunchServices LSQuarantine -bool FALSE
defaults delete com.apple.LaunchServices LSQuarantine

18章 システムの詳細設定

#247

coconutBattery

#248

sudo pmset -a hibernatemode 25
sudo pmset -a hibernatemode 3
sudo pmset -a hibernatemode 0

#249

sudo pmset -b disksleep 5
sudo pmset -b disksleep 10

#260

ターゲットモードについて

#263

sudo pmset -a acwake 1
sudo pmset -a acwake 0

#265

sudo softwareupdate -l
sudo softwareupdate -i MacOSXUpd10.7.1-10.7.1
sudo softwareupdate -d MacOSXUpd10.7.1-10.7.1
sudo softwareupdate -d -a

#266

pmset noidle
caffeinate -s -t 3000

ページ先頭に戻る

19章 困ったときには

#269

MemTest86

#271

yes > /dev/null

#273

リカバリ用のUSBメモリを自動で作成するユーティリティ

20章 無用の用?

#280

アンドロメダ銀河のオリジナルの画像

#282

ポップアップウインドウとダイアログボックス
defaults write -g NSAutomaticWindowAnimationsEnabled -bool FALSE
defaults delete -g NSAutomaticWindowAnimationsEnabled
クイックルック
defaults write com.apple.finder QLPanelAnimationDuration -int 0; killall Finder
defaults delete com.apple.finder QLPanelAnimationDuration; killall Finder
Mission Control
defaults write com.apple.dock expose-animation-duration -int 0; killall Dock
defaults delete com.apple.dock expose-animation-duration; killall Dock
ダイアログボックス
defaults write -g NSWindowResizeTime -float 0.01
defaults delete -g NSWindowResizeTime
Launchpad
defaults write com.apple.dock springboard-show-duration -int 0
defaults write com.apple.dock springboard-hide-duration -int 0
killall Dock
defaults delete com.apple.dock springboard-show-duration
defaults delete com.apple.dock springboard-hide-duration
killall Dock
Launchpadのページを切り替える速さ
defaults write com.apple.dock springboard-page-duration -int 0; killall Dock
defaults delete com.apple.dock springboard-page-duration; killall Dock
Dock
defaults write com.apple.dock autohide-time-modifier -int 0; killall Dock
defaults delete com.apple.dock autohide-time-modifier; killall Dock

#285

「XXX」の部分を置き換えてください

nohup /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -module XXX -background
killall ScreenSaverEngine
do shell script "nohup /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -module XXX -background"

#286

defaults write com.apple.dock mineffect -string suck; killall Dock
defaults delete com.apple.dock mineffect; killall Dock

#287

defaults write com.apple.dock largesize -float 512; killall Dock
defaults delete com.apple.dock largesize; killall Dock
killall Dock

ページ先頭に戻る

21章 プログラマ御用達

#289

tell application "System Events" to set quitapps to name of every application process whose visible is true and name is not "Finder"
repeat with closeall in quitapps
  quit application closeall
end repeat

#295

ls -la | open -f
ls -la | open -f -a TextMate
ls -la | pbcopy
echo 〈検索対象文字列〉 | pbcopy -pboard find
pbpaste > textfile.txt
pbpaste -pboard find > textfile.txt

TextMate

22章 その他のワザ

#299

defaults write com.apple.dock desktop-picture-show-debug-text -bool TRUE; killall Dock
defaults delete com.apple.dock desktop-picture-show-debug-text; killall Dock

#301

defaults write com.apple.dock itunes-notifications -bool TRUE; killall Dock
defaults write com.apple.dock notification-always-show-image -bool TRUE; killall Dock
defaults delete com.apple.dock itunes-notifications; killall Dock
defaults delete com.apple.dock notification-always-show-image; killall Dock

#302

sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo 1
sudo defaults delete /Library/Preferences/com.apple.loginwindow AdminHostInfo

#305

アップル製のアプリやハードウェアの資料

ページ先頭に戻る