Twitter

Web Dev Notes

By day, I am a mild-mannered web developer. These are related notes.

Thursday
Apr262012

Where is FileMerge on Lion?

/Applications/Xcode.app/Contents/Applications

Friday
Apr202012

Automator script to copy all open URLs in Safari to clipboard

Problem

You need to send someone (or do anything with) a list of URLs you have open (in Safari or Chrome on Mac).

Solution

Use this Automator workflow script:

on run {input, parameters}
	set _urls to {}
	tell application "Safari"
		repeat with _tab in tabs of window 1
			set end of _urls to URL of _tab
		end repeat
	end tell
	set {_tid, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
	set the clipboard to _urls as string
	set AppleScript's text item delimiters to _tid
	
	return input
end run

Then, just paste wherever you like!

Sunday
Mar182012

The Pad in 2022?

Is it silly to suppose that a future iPad might simply be called Pad? Think about it. If a company can redefine a common verb like "like," isn't it possible to redefine a proper and much less commonly used noun?

Wednesday
Mar142012

Open selected text in TextMate with Automator

Like most developers with a Mac I presume, I love TextMate! One of the things I have often wanted to do is to select text in an application and paste it into TextMate. Thanks to Aaron at 9thport.net, here is a dead-simple solution!

Steps

  1. Open Automator.
  2. Make a new Service script.
  3. Add Run Shell Script.
  4. Write "cat | mate" and save as "Launch TextMate".
  5. Open System Preferences.
  6. Go to Keyboard > Services.
  7. Check Launch TextMate and give it a shortcut, like F6.
  8. Go to an application with text, select it, and hit F6!

 

Saturday
Feb112012

Find and replace with phpMyAdmin

To find and replace in phpMyAdmin, use this:

UPDATE tablename SET fieldname = REPLACE(fieldname, "old", "new");