How I like to code

Monthly Archives: June 2011

Running AppleScript commands from the Terminal.app

I found some pages on the web on how to run an AppleScript from the terminal, but this seems to be the only one that works in my situation: ?View Code APPLESCRIPTecho ‘tell application "Google Chrome" to quit’ | /usr/bin/osascript In my case, my keyboard stopped working so I wanted to safely shut down the […]

More fun with symbols

I found some very useful environment variables you can set on the application you are debugging when you need to see what symbols are being recorded by dlopen when it opens all of the libraries in your application: click on me, click on me please! So, from your Xcode project, double click your debug app: […]

Adobe Scripting Additions

I’ve been getting warning messages in my Console log stating the “Adobe Unit Types.osax” has deprecated functions. Then, when I starting scripting Xcode with AppleScript, I’ve been getting a bunch of errors about the above listed library. Well, Adobe had something to say about that: http://kb2.adobe.com/cps/516/cpsid_51615.html

Ninja Glock

Thanks to thefirearmblog.com for sharing this video:

How to duplicate one file … a lot

I had to duplicate a file… over a thousand times, for a test. For the MacOS, I created a shell script to do this: ?View Code BASH#!/usr/bin/env bash   # I’m passing in the filename as a parameter to the shell script, # which is accesible through $1 for (( i = 0; i < […]

Apple announces iCloud

Apple announced the iCloud service and for someone like me, this is a great service. For a while, I have been battling with the problem of having access to common data on multiple computers, whether that be documents, calendaring information, or other documents from multiple computers. Having access to that data without having to rely […]

Xcode Script Menu and P4

Here is another way that I am able to check out a file using the Xcode Script Menu and a keyboard hot key: ?View Code BASH#!/bin/sh # This shell script checks out the current file from Perforce   # Get the file’s path components FULL_FILE_PATH="%%%{PBXFilePath}%%%" SRC_FILE=${FULL_FILE_PATH##*/} FILE_PATH=${FULL_FILE_PATH%/*}   # This line brings in my settings […]

Starting Google Chrome without restoring previous session

If you ever needed to open Google’s web browser Chrome, without having the previous session brought back, you can actually do this from the command line. On the MacOS, you can use the Terminal.app application to type in the following commands: ?View Code BASH$ cd /Applications $ ./Google\ Chrome.app/Contents/MacOS/Google\ Chrome –home Google Chrome should start […]