Archives for posts with tag: mac

I know this is total n00b stuff but I always forget the particular so I thought I’d write it down in a blog entry.

To add a custom scripts directory to your path, do the following:

In your root directory, create a file called .bash_profile with something like the following:

if [ -f $HOME/.bashrc ]; then
        . $HOME/.bashrc

Then in .bashrc, put something like the following:

export PATH=$PATH:$HOME/Scripts

Make both scripts executable:

chmod +x .bash*

For extra credit, create a softlink from your Dropbox folder to your scripts folder and you can have the same scripts on all of your computers!

ln -s $HOME/Scripts $HOME/Dropbox/Scripts

Occasionally I need to produce YouTube HD videos showing me doing something in a web browser. Up ’till now I’ve had to painfully, manually resize the browser window to 1280×720 so that the video didn’t get unnaturally shrunk or expanded by my screencast rendering software. Tonight I figured out a way to automatically resize my browser window to the exact dimensions using AppleScript.

Here is the magical incantation:

tell application “Safari”

set the bounds of the first window to {0, 0, 1280, 720}

end tell

Run this application in AppleScript Editor (/Applications/Utilities/AppleScript Editor) and your browser will be the perfect size for recording movies. You can save the script to a folder for later reuse.