minitip – Upon my shoulder http://www.uponmyshoulder.com/blog // TODO: insert witty tagline Tue, 20 Jun 2017 20:25:30 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.8 Semibold keyboard shortcut in Pages http://www.uponmyshoulder.com/blog/2011/semibold-keyboard-shortcut-in-pages/ http://www.uponmyshoulder.com/blog/2011/semibold-keyboard-shortcut-in-pages/#respond Thu, 26 May 2011 13:08:08 +0000 http://www.uponmyshoulder.com/blog/?p=440 Continue reading Semibold keyboard shortcut in Pages]]> So… Turns out there is no shortcut to turn text to semibold in Apple Pages, from the iWork suite. There are shortcuts for bold and italic respectively, but not semibold (or light / ultralight for that matter) even for the fonts that support it.

The closest thing to a solution that I found is through Character Style:
– Select a piece of text, make it semibold
– In the Styles Drawer, under Character Styles, click on the little arrow next to “none” and “Create New Character Style From Selection
– Assign a Hot Key to the newly created Character Style, by clicking the arrow next to it and Hot Key.

There are a few drawbacks to this approach, mainly that the character style you’re defining will be tied to a particular font, and that the only shortcuts allowed by the Hot Key setting are F1 to F6. If anyone has a better way, I’m all ears!

]]>
http://www.uponmyshoulder.com/blog/2011/semibold-keyboard-shortcut-in-pages/feed/ 0
Automatically restart applications on OS X http://www.uponmyshoulder.com/blog/2011/automatically-restart-applications-on-os-x/ http://www.uponmyshoulder.com/blog/2011/automatically-restart-applications-on-os-x/#comments Sat, 07 May 2011 08:53:33 +0000 http://www.uponmyshoulder.com/blog/?p=433 I use GimmeSomeTune to provide hotkeys and some other goodies for iTunes. It works alright, but is veeeery crashy — usually every dozen hours or so on my machine.

How to fix that? Let’s relaunch it as soon as it crashes. Simple!

In a terminal:
for (( ; ; )); do open -W /Applications/Multimedia/GimmeSomeTune.app/; done

open is the bash command to launch applications on OS X. It works with all kinds of files: open somefile.avi will open that file in your default video player, VLC for example. The -W flag tells open to wait until the application exits before returning any value. By putting it all in a for loop, we effectively ensure that bash will launch GimmeSomeTune, wait until it crashes, then relaunch it, and so on.

Edit: this is a bad way of doing things. A better way is described here.

]]>
http://www.uponmyshoulder.com/blog/2011/automatically-restart-applications-on-os-x/feed/ 1
Ye old Dock: Leopard-style Exposé under Snow Leopard http://www.uponmyshoulder.com/blog/2011/ye-old-dock-leopard-style-expose-under-snow-leopard/ http://www.uponmyshoulder.com/blog/2011/ye-old-dock-leopard-style-expose-under-snow-leopard/#respond Thu, 27 Jan 2011 19:23:09 +0000 http://www.uponmyshoulder.com/blog/?p=377 Samuel Clay shares an awesome little tweak: replace Snow Leopard’s Dock.app by the Dock.app from a beta version of SL, and Exposé will get back to the way it acted on Leopard, i.e. the size of the thumbnail is proportional to the size of its window.

And it rocks.

]]>
http://www.uponmyshoulder.com/blog/2011/ye-old-dock-leopard-style-expose-under-snow-leopard/feed/ 0
Synchronize and backup Address Book contacts with Dropbox http://www.uponmyshoulder.com/blog/2010/synchronize-and-backupaddress-book-contacts-with-dropbox/ http://www.uponmyshoulder.com/blog/2010/synchronize-and-backupaddress-book-contacts-with-dropbox/#respond Sun, 31 Oct 2010 09:56:30 +0000 http://www.uponmyshoulder.com/blog/?p=311 A nice way to synchronize contacts between your Macs without having to buy a MobileMe account is to have them on your Dropbox.

Basically, it boils down to moving the folder containing your Address Book data on your Dropbox, then adding a symbolic link to it so Address Book will know where to find its data.

Let’s go on bash!

Move the folder:

$ mv -v ~/Library/Application\ Support/AddressBook ~/Dropbox/

Add a symbolic link:

$ ln -s ~/Dropbox/AddressBook/ ~/Library/Application\ Support/AddressBook

Done!

Now you’ll only have to add the symbolic link to every Mac you want to synchronize (you may also need to remove the existing AddressBook folder). Another awesome consequence is that you don’t have to worry about losing your contacts if your hard drive crashes: they’re safe in your Dropbox.

A word of advice though: Address Book was not originally meant to be used this way. It would be wise not to edit your Address Book from the two computers are the same time, for example.

]]>
http://www.uponmyshoulder.com/blog/2010/synchronize-and-backupaddress-book-contacts-with-dropbox/feed/ 0
A keyboard shortcut to change files colours in the Finder? http://www.uponmyshoulder.com/blog/2010/a-keyboard-shortcut-to-change-files-colours-in-the-finder/ http://www.uponmyshoulder.com/blog/2010/a-keyboard-shortcut-to-change-files-colours-in-the-finder/#comments Wed, 19 May 2010 22:30:06 +0000 http://www.uponmyshoulder.com/blog/?p=244 My usual habit (some would call it an intermittent OCD, but meh) of sorting and organizing files and folders to a great extend and my almost as severe relentless longing for optimisation recently met in an existential question: is it possible to colour files in the Finder through a keyboard shortcut?

OS X lets you add colours -or “labels”– to a file by right-click or in the Finder’s File menu. GUI are cool, but get in the way of efficiency once you know your keyboard inside and out.

Well, after some research, it seems that such a shortcut does not exist. You can’t even create a shortcut the usual way, as the “Label” menu point stands for all labels. (I’ll eventually describe the usual method in this blog!)

The simplest way to implement such a feature was to create a set of AppleScripts that colour files that are currently selected, and launch them via the most amazing QuickSilver. Or Alfred. Or even Spotlight.

The AppleScripts look like that:

property file_color : 5
-- replace '5' above with the number for the color you'd like to use:
-- 0=none, 1=orange, 2=red, 3=yellow, 4=blue, 5=purple, 6=green, 7=grey 

tell application "Finder"
	activate
	set items_ to selection
	repeat with item_ in items_
		try
			set label index of item_ to file_color
		on error e
			display dialog e
		end try
	end repeat
end tell

This is the purple one. Therefore, I called it scp_SetColourPurple.scpt and dropped it off somewhere QuickSilver indexes – proceed this way for each colour you want to add.

All it takes now to colour a set of files is to select them in the Finder, type in Ctrl+Space (to summon QuickSilver) and the three letters to your colour of choice – scp to set the coulour to purple, scr to set colour to red, scy to set colour to yellow…

(Full disclosure: the above code was originally found somewhere on the internet, I can’t find where right now. If I find the link again, or if someone can point it to me, I’ll give props to the original author.)

]]>
http://www.uponmyshoulder.com/blog/2010/a-keyboard-shortcut-to-change-files-colours-in-the-finder/feed/ 2
Get database size in phpMyAdmin http://www.uponmyshoulder.com/blog/2010/get-database-size-in-phpmyadmin/ http://www.uponmyshoulder.com/blog/2010/get-database-size-in-phpmyadmin/#comments Wed, 28 Apr 2010 19:19:56 +0000 http://www.uponmyshoulder.com/blog/?p=205 It looks like phpMyAdmin doesn’t include a way to see how much space takes the MySQL database. I found that a bit weird, but hey, if phpMyAdmin doesn’t do it, let’s cut to the chase and go SQL!

The most straightforward way to get your database size from phpMyAdmin is the following SQL query:

SELECT table_schema "Data Base Name",
sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES GROUP BY table_schema ;

Originally from the MySQL forums.

]]>
http://www.uponmyshoulder.com/blog/2010/get-database-size-in-phpmyadmin/feed/ 13
Changing an application icon under OS X http://www.uponmyshoulder.com/blog/2010/changing-an-application-icon-under-os-x/ http://www.uponmyshoulder.com/blog/2010/changing-an-application-icon-under-os-x/#comments Sun, 11 Apr 2010 22:17:08 +0000 http://www.uponmyshoulder.com/blog/?p=152 I don’t like the default icon for Preview.app in OS X.

The sight of that child, giving me this creepy grin, sitting here in the Dock while I’m browsing pictures, is just weird.

Icon for preview.app
Seriously!

There are two ways to make him go away.

The hard way

I call this method the hard way because it involves having another .icns file (the filetype for OS X icons), and navigating through folders supposed to be hidden. But it doesn’t matter, you’re a hardcore user!

Right-click Preview.app and click “Show Package Contents”.
Navigate to Contents/Resources.
Replace Preview.icns with the icon of your choice.

The easy way

This method allows you to replace an icon with another application’s icon.

Open the information panel of said other application (Cmd+i in the Finder).
Click on the big icon at top-left (not the one in the menu bar).
It will appear highlighted:
The information panel with an highlighted icon

Enter Cmd+c to copy it.

Open Preview.app’s information panel.
Click on the icon:
Preview.app's information panel before changing the icon
Enter Cmd+v.

Voilà!
Preview.app's information panel after changing the icon

Another advantage of this second method is that it also works for disks, folders, and about any file.

You can find a lot of great icons at InterfaceLift (though it doesn’t seem to be updated very often). The icon I used to replace the child is part of the Aqua Neue set.

]]>
http://www.uponmyshoulder.com/blog/2010/changing-an-application-icon-under-os-x/feed/ 1
Put OS X to sleep via command-line http://www.uponmyshoulder.com/blog/2010/put-os-x-to-sleep-via-command-line/ http://www.uponmyshoulder.com/blog/2010/put-os-x-to-sleep-via-command-line/#comments Thu, 25 Mar 2010 15:25:13 +0000 http://localhost:8888/wordpress/?p=81 When connecting to an OS X box via SSH, you may want to put it to sleep after you’re done.

This is no system call to put the computer to sleep that I know of. However, Applescript can do it, and it is trivial to call the OSAScript interpreter in bash.

The following script puts the computer to sleep:

#!/bin/bash

osascript -e 'tell application "System Events" to sleep'

Edit: found a better way!

I don’t know if this is specific to Snow Leopard, but the following command will work as well without having to use Applescript or administrator rights:

pmset sleepnow
]]>
http://www.uponmyshoulder.com/blog/2010/put-os-x-to-sleep-via-command-line/feed/ 13
On designing mockups http://www.uponmyshoulder.com/blog/2010/on-designing-mockups/ http://www.uponmyshoulder.com/blog/2010/on-designing-mockups/#respond Thu, 11 Mar 2010 23:47:17 +0000 http://localhost:8888/wordpress/?p=75 As part of a group project, I am currently involved in designing an application from the ground up. Designing the UI first drafts, before even chosing a programming language or environment, is something that should be easy and straightforward. We needed a tool that allows easy sharing between people, regardless of operating system.

Please welcome Mockingbird.

An amazing web application to design sleek and elegant UIs, Mockingbird is Javascript-based (no Flash!) and especially powerful if you’re working as part of a team or if you share a lot of mockups. Try it!

]]>
http://www.uponmyshoulder.com/blog/2010/on-designing-mockups/feed/ 0
Screenshots and OS X: capturing a single window http://www.uponmyshoulder.com/blog/2010/screenshots-and-os-x-capturing-a-single-window/ http://www.uponmyshoulder.com/blog/2010/screenshots-and-os-x-capturing-a-single-window/#comments Fri, 22 Jan 2010 23:22:01 +0000 http://localhost:8888/wordpress/?p=12 One pretty awesomely simple thing under Mac OS is making great screenshots.

You might already be familiar with Mac OS X’s classical shortcuts for screenshots, Shift+Cmd+3 (full screen) and Shift+Cmd+4 (selection). But did you know you can shoot a single window without the hassle of selecting it from edge to edge, or worse, cropping from a full screenshot?

Press Shift+Cmd+4, then press the space bar.

A little camera appears, and allows you to capture the highlighted window of your choice.

The resulting image can be found at the same place as usual screenshots – by default, on the desktop, as a PNG file. With transparency and drop shadows, nothing less!

NB: apart from “real windows”, this camera can also capture the Dock, the menu bar, the desktop wallpaper, and even widgets.

]]>
http://www.uponmyshoulder.com/blog/2010/screenshots-and-os-x-capturing-a-single-window/feed/ 3