Shell
Scripts.
Shell
Scripts control your mac through the base UNIX system that
lurks under OS X. They can do some things AppleScript
can't, through it's use is a little more risky, since UNIX
commands don't have the failsafes built into OS X. What
could be the worse that could happen? You could obliterate
your OS, that's about it. So be careful with these
commands.
Set shell to
bin/bash
for all, unless noted otherwise.
Clipboard:Append
This can add a known filepath ending to a partial filepath
on the clipboard or just add more text to it without
deleting what's there. The example below adds
"/Contents/Resources"
to the end of the clipboard text.
(thx: Gary Kerbaugh & Cole Tierney)
pbpaste
| awk '{print} END {print "/Contents/Resources/"}' | pbcopy
CD
R/W Erase
hdiutil
burn -erase
Show
Hidden Files / Rehide Files
I give these as twins because you really will want to use
both in the same script. You may want to show all files to
access them, but you'll probably want to hide them again by
the end of the Workflow. Sets the file visibility, then
restarts the Finder.
Show Hidden Files
defaults
write com.apple.finder AppleShowAllFiles -bool true
killall
-HUP Finder
Rehide
Files
defaults
write com.apple.finder AppleShowAllFiles -bool false
killall
-HUP Finder
Restart
Finder
killall
-HUP Finder
Repair
Permissions
sudo diskutil repairPermissions /