Skip to content

Instantly share code, notes, and snippets.

@robmooney
robmooney / Crop iOS Status Bar.scpt
Created April 18, 2012 14:00
An AppleScript for cropping the iOS status bar out of screenshots in Photoshop.
property iphone_portrait : {w:320, h:480}
property iphone_landscape : {w:480, h:320}
property iphone_2x_portrait : {w:640, h:960}
property iphone_2x_landscape : {w:960, h:640}
property ipad_portrait : {w:768, h:1024}
property ipad_landscape : {w:1024, h:768}
property ipad_2x_portrait : {w:1536, h:2048}
property ipad_2x_landscape : {w:2048, h:1536}
tell application id "com.adobe.Photoshop"
@robmooney
robmooney / Insert UIColor.applescript
Created June 9, 2011 17:34
Generate a UIColor with the colour panel from right inside Xcode
(*
Generate a UIColor with the colour panel from right inside Xcode
To install place in ~/Library/Scripts/Applications/Xcode/ and enable the Script
menu in AppleScript preferences (or use FastScripts)
Limitations:
Doesn't support alpha values
@robmooney
robmooney / gist:923301
Created April 16, 2011 17:07
Get the MKCoordinateRegion that encompasses a set of MKAnnotations
// returns a MKCoordinateRegion that encompasses an array of MKAnnotations
- (MKCoordinateRegion)regionForAnnotations:(NSArray *)annotations {
CLLocationDegrees minLat = 90.0;
CLLocationDegrees maxLat = -90.0;
CLLocationDegrees minLon = 180.0;
CLLocationDegrees maxLon = -180.0;
for (id <MKAnnotation> annotation in annotations) {