Lowfokus
Archive for category OS X
Resizing An Image Without An Image Editor — Using Automator
Posted by technohermit in Apple, Automator, OS X, Uncategorized on 2009/10/25
This is a fast and easy way to scale the size of an image (or a bunch of images) using OS X’s built in utility Automator. It is very simple (also crude), but it works and the results are pretty decent.
(You can scroll down to the end of the post if you just want the Automator applications and don’t care how I got there.)
First set up the job in Automator by opening the application in /Applications:
Next, choose workflow from the opening screen and select choose (or just hit enter if they’re already highlighted):
The next screen has built in functions to select by category. In the first column, select “Files & Folders“. Column 2′s selections are based upon what you select in column 1. Now the next additions to your workflow will depend upon your desired task. If you’d like to convert a single image, or if you plan on converting a bunch of images in a folder.
First we’ll cover how to make a simple workflow that you can use to select one image, start the workflow, and exit Automator.
With “Files & Folders“ selected in the first column, drag “Get Selected Finder Items“, followed by “Copy Finder Items” into the right hand area.
Next, in the first column, select Photos. Find “Scale Images” and drag that to the right hand actions area, so it is at the bottom. Your workflow should look like this:
Next, we want to adjust an options on ”Copy Finder Items” and “Scale Images” to force the workflow to ask for a values, rather than having to manually open Automator, change them, and click “Run”. That Would be tedious, and we are looking for simple. So, click the options button in the “Copy Finder Items” and ”Scale Images” portions of your workflow, and click the check box “Show This Action When Workflow Runs” in both of them:
With that done, just use the “Save As” in the file menu (⇧⌘S) and save the file as an application:
That’s it, really. You can now drag an image file onto the new application, it will ask you where to save the resized image, as well as ask you for the type of scale. You can set by percentage, or by pixels, and set the value based upon how you chose to scale it. Scaling by pixels appears to be based upon the width, and then uses the same scale factor to the height automatically.
Now, you can adjust this application to do a whole batch of files inside a folder, if you’d like. First, open Automator, click “Open Existing Workflow”, and choose your new application created above. Drag “Get Folder Contents” and place it under “Get Selected Finder Items” in the workflow. Your new workflow should look like this:
Again, click “Save As” in the file menu, and select a new name for this application. You can now drag a folder of images and drop it on the application to resize a batch of images.
There are other options in the Photos section of the Library of actions (the left hand column) such as changing the file type as well, for instance if you have a bunch of jpg’s and want to make them png’s for the web.
I hope this gets you interested in Automator–a totally useful and underrated tool–and happy image scaling!
Download the Single File Application or the Folder of Images Application here if you’d like. You can update and change them by opening them with Automator.
Simple Introduction To Apple’s Unix Using Terminal on OS X
Posted by technohermit in Apple, Entry Level Programming, OS X, OS X Shell, Uncategorized on 2009/10/24
This post is for someone interested in learning UNIX on Mac OS X Snow Leopard, but lacks experience using a command line, or has only C:\ prompt knowledge. I will show you, simply, how to map a DOS command to a UNIX command, and to save your profile so the alias name you create is persistent. If you are a shell scripting genius, this post is something you are encouraged to comment on and expand upon, as learning scripts and commands for OS X can be input many different ways. It never hurts to have different suggestions. I will try to make this at the minimum a weekly edition to my blog, and expand each article further than the next.
Let’s get started. First, open Terminal from your /username/Applications/Utilities folder. This is the command line utility for UNIX, by default it is Bash (Bourne Again Shell.)
You will see your entire present working directory prior to the $ prompt. The tilde (~) represents /Users/your home folder. The standard format is computer name: pwd. You can type the simple command pwd and the shell will respond with the folder you are currently accessing.
I like a cleaner shell screen, so I type bash, and hit enter. This opens a new bash shell, on top of the existing shell. Next, the command clear deletes the current Terminal text and starts with a fresh bash prompt. You end up with a Terminal screen that looks like this:
Here, we can start by showing the man (short for manual; built in UNIX help pages) page for the command ls (list), which is basically the dir command in DOS. Simply type man ls at the command line and hit enter. You can move down the pages line by line using the down arrow key on your keyboard. To exit the manual, simply type q.
The man page shows you the various options you can use along with the ls command, for example, ls -lia. This command is particularly useful when searching a directory for hidden files (they start with a period), as Finder refuses to display them by default:
Now, if you are used to DOS, here is a helpful way to stick with the commands you know, yet tell Terminal to run UNIX commands. You create an alias, basically a command name you make up mapped to a system command. If you want to use options such as -lia, you need to enclose the command in double quotes. The syntax of the alias command in bash is alias newCmdName=systemCmdName. The command in DOS for a directory listing like the one above is dir /a. So we can map dirA to ls -lia like so: alias dirA=”ls -lia”
Note that UNIX is also case-sensitive, for files as well as commands:
You can simplify entering commands by using the up arrow to cycle through previously typed in commands. The history command, saves the commands you enter by line number, which you can view by typing history. To execute the line number, type an exclamation point followed by the line number:
Now, to save this new alias dirA you created into your bash profile. This way it doesn’t get erased when we kill the shell and quit Terminal. You may not have a profile set up for bash in your home directory, so what you need to do is create one. Bash will look for .bash_profile first, so it is best to name any profile you want to use on a regular basis with this name. It is a hidden file, so you need to have the period in the file name. For simplicity, you can create a simple text file in your favorite text editor, name it bash_profile (without an extension)and save it in your home directory. Write the exact command on one line like so: alias dirA=”ls-lia”
Save the file, and then change the name in Terminal. Use the command mv to change the name so it begins with a period. Simply type mv bash_profile .bash_profile and press enter:
That did two things: one, you moved the file; two, you learned that mv is the same command as the DOS command move. You can follow the procedure above to make an alias for the mv command, and place it on the next line in your .bash_profile, so it remains permanent for your login shell. If you like running an “non-login” shell as I do above, you can use the command cp to copy your .bash_profile to .bashrc like so: cp .bash_profile .bashrc
Here is a short list of a few DOS commands, along with their respective UNIX bash counterparts (pdf of list here):
|
DOS COMMAND |
UNIX COMMAND |
|
DIR |
LS |
|
MOVE |
MV |
|
COPY |
CP |
|
FIND |
GREP, FGREP, EGREP |
|
MEM |
TOP (virtual memory use VM_STAT) *use ctrl-c to end TOP command* |
|
CD |
CD (PWD to display current directory) |
|
DEL |
RM |
That’s all for this quick lesson. Stop by next week for more DOS examples in UNIX, and (hopefully) working with vi, UNIX’s text editor.
E-Mail and Optimum Online — Updated With Response From OOL
Posted by technohermit in Internet, iPhone, Mail, OS X, Programs, Uncategorized on 2009/10/23
[Looking for iPhone settings and Optimum Online? Click here. ]
[Looking for POP/SMTP settings? Incoming and Outgoing Servers are both: mail.optonline.net. Scroll down for the outgoing settings.]
Update: Here it is, response straight from Optimum:
“Thank you for contacting Optimum Online regarding your question about email. We apologize for any inconvenience this may have caused you and will be happy to assist. I do apologize, apart from normal unencrypted POP/SMTP there is no SSL option at this time to encrypt your connections.”
Sorry guys, that’s it. Nothing about any if/when they might include it, or any hint of a plan to include it at all. Unfortunate. [/Update]
I get a lot of hits on my post here about the iPhone Mail and Optimum Online, so I figured I’d write a post on regular old computer mail as well.
The problem basically is that Optimum doesn’t allow SSL connections to their servers, either outgoing or incoming. They only allow secure log-in to their servers through HTTPS port 443 on their Optimum Webmail Portal. I currently have a question in to them about using SSL with third party applications and am awaiting a response. You see, on 1xRTT or 2G EDGE, it is still quite fast to download e-mails through your phone. But in order to pass encrypted information, you would need to access your e-mail through your phone’s browser of choice (Safari on the iPhone, in my case.)
This problem extends to your mail application regardless of operating system. I will show you how to set up an email address using Optimum Online through Mail on OS X.
Mail, helpful application it wants to be, will automatically check your connection settings when you type in your name and email address. Poor Mail, though, fails miserably at connecting via SSL, and asks you if you’s like to continue, or setup your account manually.
So, to start setting up your e-mail (if you don’t yet have one setup through OOL, you can do so here) first open Mail. Then open preferences with ⌘-, (holding ⌘ and pressing comma.)
This brings you to your account page, where you will begin setting up your new account. I am using Mail on Snow Leopard, but the steps to follow are similar enough in Leopard and Tiger for you to follow along. Click on the “Accounts” tab in the top of the window, which brings you to this screen:
Once there, click on the “+” button to add your new account. Mail will ask you for your Full Name, User Name, and Password, and then try to automatically set you up with the correct servers:
Click continue, and Mail will tell you it cannot connect securely to the servers:
Click “Setup Manually” so you can adjust the account settings, and begin sending and receiving your mail. Using Optimum, you are going to setup a POP mailbox, and both your incoming and outgoing mail servers are mail.optonline.net :
Click continue, and then you want to disable the SSL by unchecking the “Use Secure Sockets Layer (SSL)” check box, but still have “Authentication” set to “Password”:
Click Continue, and you will be brought to the outgoing server section. Enter a description for the server, which is something you will use to identify it in Mail. It has no other significance. Check the box that says “Use only this server”, as well as “Use Authentication”. Enter in your username without the “@optonline” or “@optimum” ending, as well as your password:
You will then be told, once again, Mail cannot connect securely to the server. Again, click “Setup Manually”, which takes you to here:
Leave these settings intact, and click “Continue”. You will be shown an Account Summary screen, and both incoming and outgoing mail should say SSL off. Be sure the “Take Account Online” box at the bottom is checked, and click “Create”.
I am waiting to hear back from Optimum about a different port or setting allowing SSL connections via third party mail clients, and hopefully I just couldn’t find the correct port to use. If not, here’s to hoping they are working on getting SSL enabled soon!
Typing Special (Unicode) Characters in Snow Leopard
Posted by technohermit in Apple, OS X, System Preferences, Uncategorized on 2009/10/22
[You can find the hex code for common symbols here if you already set up your Unicode Keyboard layout. ]
Wondering how to make special characters, such as the Command (⌘) Symbol in OS X Snow Leopard? Maybe you want to add the Euro (€) symbol? It’s not as hard as you may think. They are Unicode characters, and there are a few simple steps to make them easy to type on screen.
First, open System Preferences. I like to use LaunchBar, so I type ^Tab, press”sy”, and hit enter. For those of you who like the mouse (gasp!): System Preferences is in your dock by default, or it’s found in your Applications folder.
Once there, click the flag icon “Language & Text”. Next, click “Input Sources”:
Scroll down until you find Unicode Hex Input, and check the box. I also like to have the option shown in my menu bar by the clock, so I leave the “Show Input menu in menu bar” box ticked:
In the same window, click the “Keyboard Shortcuts” button. In the next window, click “Keyboard & Text Input”:
Here is where you decide how to switch between your normal keyboard and the Unicode Hex keyboard layout. The options are called “Select the previous input source” and “Select next source in Input menu”. To change the option, click where the keys are to the right of the name of the shortcut, select all of the keys in the box, and then input your new keystrokes. I chose to hold down Control, Option, Command, and Space Bar (daunting I know.)
Holding down your shortcut gives you this window where you can arrow key through your options:
The key difference between Unicode and US is the function of the option key. In Unicode layout, you hold down the option key and enter the Hex code for the symbol you’d like to type on screen. For example, holding down option and pressing 2 in a US keyboard layout gives you the trademark symbol, ™. Whereas in the Unicode Hex layout, you need to hold down option and type four keystokes to make a symbol. ⌘ is Option and then 2318.
To find the Unicode “code” for your symbol, open the Character Viewer by pressing option-command-T (⌥⌘T) or by clicking the flag near your clock in the menu bar, and then clicking on Show Character Viewer:
Looking at the Character Viewer (⌥⌘T), you can attempt to find your symbol with the search field at the bottom. Clicking on a symbol will tell you which four keys to type while holding down option (and being in the U+ keyboard layout):
I chose the Euro as an example, and you can see in order to type the symbol, I hold down option and press 20ac (caps not necessary, although it is shown that way): €.
The keyboard viewer also helps identify the keymap of a new language layout. Although there isn’t a noticeable change between US and Unicode, you may see quite a change picking something like Canadian French or Dvorak.
Good luck and happy character typing!
PS– To type the apple () symbol, in a US keyboard layout, hold down Option+Shift, and press k. No special keyboard required!
LaunchBar, Quicksilver (OS X) or Colibri (Windows)
Posted by technohermit in Apple, OS X, Programs, Uncategorized, Windows on 2009/10/21
Apple’s notebook line has been selling like wild for quite some time now, and I think it’s appropriate for notebook users to know about these programs. Even desktop users should have them, but there is literally no excuse for a laptop jockey to forego them. My wife, a vested Windows laptop user, has the option of Colibri. These programs are interchangeable in what they do for the most part, so I’ll just go ahead and write about them as a group.
They are all handy little applications that index your files, programs, webpages and such so they are no more than a keyboard shortcut away. I cannot stress enough how much time and effort these programs save. They remove the tedious movements and tendon crippling one-finger clicking a mouse can produce. They save you countless hours per week of navigating through the Finder or Start Menu. You can launch pretty much any application within three keystrokes, which for a notebook user is indispensable. Imagine sitting on a plane and not missing your mouse. You can open songs, albums, files, pictures, you name it and it’s indexed.
LaunchBar has been my application of choice since I was on Panther, so I am a bit biased towards that one in particular. The downside is a license will cost you roughly €24. Quicksilver and Colibri are both free licenses at the time of this writing.
I’ll let you decide which is right for you, but be warned: this is like going from dial-up to broadband. You get the good stuff and you’ll never live without it again. So for those choices that are donationware, I strongly suggest you keep their development teams happy and throw them some coin.
Here’s the links:
As I said, I’m a huge proponent of LaunchBar, they give free updates, and have one of the fastest interfaces on the planet. See below for screenshots of the preferences panels, and if that isn’t enough go ahead and click on the link above and download the free trial. You won’t be sorry!
Downloading and Installing Applications on OS X
If you are a new Mac user, switching from Windows, or just new to computers in general, you may not know there is something a little bit different in the way you install programs on Mac OS X.
Many people I know run into trouble installing applications they download from the internet, simply because they are not used to dropping an application into the “Applications” folder from a mounted virtual disk. My brother had 4 copies of Google Earth downloaded, none installed, and wondered why it was “reset” every time he tried to run it. So, for those of you out there trying to figure out why you cannot just drag the icon into the dock and run it at will, here is a tutorial made just for you.
First, download your application. In OS X, on Safari, the default location for your downloads is in your “Downloads” folder, located inside your “Home” folder. To access this location, find “Finder” on the left hand side of your dock (by default.) It looks like this:
When you click on the icon in the dock it will open a new Finder window. You can accomplish this same task by holding down ⌘ and hitting N, or “Command-N”. Be sure it says “Finder” by the in the menu bar, upper left hand corner of your screen. You should see something similar to this:
I am currently running OS 10.6.1, Snow Leopard, but the above ⌘-N works throughout OS X. Also, I have already clicked on the “Home” folder (looks like a house) and the Downloads folder inside of Home. That is why they are highlighted in blue. If you do not have this view enabled, it may look like this:
You can see the top center of the window shows my Home Folder, meaning this is the directory you are currently located in. You can use your arrow keys to navigate down the list shown in the bottom half of the window until you get to the “Downloads” folder. Hitting enter, however, will not get you into that folder. You can use ⌘-Down Arrow to go into the folder, or you can use ⌘-Right Arrow to open the folder’s contents and display it in the list. As a matter of fact, when you select any file and want to open it, using ⌘-Dn (I’ll list command-down arrow like ⌘-Dn from now on) will work. You can also hit spacebar to see a QuickView of the file. Yet, I digress.
So, now that you are in your “Downloads” folder, you can find the file you have recently downloaded. I will use Google Earth as my example here:
When you click the “Agree and Download” button, you see a new “Downloads” window open, and the file begin to transfer to your computer:
After the file transfer completes, a bunch of stuff happens. First, OS X verifies the disk image is not corrupted, and then it will mount. A file with “dmg” after the period means “Disk Image”, which basically means it is just like a CD or DVD you would put into your drive. If you had a physical disk and stuck it in your DVD drive, it would show up on your desktop, and you could click on it. Same goes for .dmg files, but you don’t need the physical disk:
The download automatically verifies, and “mounts” on your desktop, just like you had a Google Earth CD and put it in your drive. The white thing above the disk name on my desktop there is the icon for a virtual disk, or some USB drives as well.
You can also see the actual Google Earth application in the window titled Google Earth and the virtual disk picture just to the left of it. If you close that window, the disk stays mounted on your desktop. What you want to do now is actually install the program by dragging it to somewhere on your computer. This is done simply by holding down the left mouse button (trackpad button, or sometimes your only mouse button) and moving it off of the window it is currently in.
I recommend always installing programs into your “Applications” folder, to keep everything nice and tidy. Open a new “Finder” window, and below your home folder it says “Applications”. Click on the link, and it will open your “Applications” folder to the right hand side:
One thing to note here is above the “Applications” link, there is the Google Earth disk image with an Eject symbol next to it. More on that in a second, first let’s install Google Earth. Get your two windows side-by-side on your desktop, and drag the Google Earth application from it’s current window and drop it on the list in the “Applications” window. Before you let go of the mouse button, be sure there is a little green “+” sign, letting you know the file you are moving is going to be copied into this location. If you see it, go ahead and drop it in there:
Now that you have installed and application, you can unmount the disk image. First, close the window titled “GoogleEarth-Mac”. Next you can either click the eject button next to the GoogleEarth disk in the “Applications” window you still have open, or you can click once on the disk image on your desktop to highlight it. You can then drag it to the trash can in the dock (with turns into a big Eject button), or you can use the keyboard shortcut ⌘-E (command-e for ”e”-ject.)
Lastly, if you want to back up your GoogleEarthMac.dmg file, you can do so. You can leave it in your “Downloads” folder, or you can delete it. To delete it, navigate back to your “Downloads” folder, in your home directory, and highlight the .dmg file:
To send it to the Trash, simply drag it there and let go, or hit ⌘-Delete.
That’s all there is to installing an application on OS X. Once you can effortlessly find your way around the windows, installing is as easy as drag and drop!
Safari and Firefox Cache Preferences
Posted by technohermit in Apple, Internet, OS X, Uncategorized, Web Tech on 2009/10/20
I have a MacBook Pro, and I’m always trying to keep it running the best that it can. Most of the time, the trouble I have is related to the amount of space Safari and Firefox use to store files in the cache. If you would like to limit Safari’s space on your hard disk, you are kind of stuck as far as the options in the file menu’s “Reset Safari” go.
In order to reset ( or clear ) your cache, history, cookies, etc., you can easily do this by clicking Safari in the menu bar, and either selecting just “Empty Cache” or “Reset Safari” from the drop-down menu. There is a lot of options in Reset Safari, and you can partially clear certain things as you like.
You may also be interested in limiting the actual size of the cache, of which you have but one option–WebPreview, or CoverFlow. You can check here for instructions on how to disable that feature. Unfortunately, there is no option in Preferences to limit the cache size of Safari, or if there is I couldn’t find it. There is a cryptic “database size” option in the advanced section of preferences, and I am trying to find out from Apple what that is in reference to (as I have none listed in the box.) The “Database Size” in the advanced section of Preferences has been an option to JavaScript developers to store code client-side rather than server-side as a way to avoid code getting trashed by storing it with a user’s cookies. Unfortunately, after my call with Apple, there is no way to limit the size of the Cache.db file yourself (from Apple directly.) They did mention that there “may be a third party” application out there that could do this for me, of which I will have to scour the intrawebs to find. My cache.db is 180MB after only two days of having cleared it. Bummer.
Firefox, on the other hand, does give you the option to limit the cache size in Preferences –> Advanced –> Network:
This is nice to have, and the default is a modest 50MB. I’ve had Safari’s WebPreview images top 500MB, which is just out of hand.
Firefox also has the ability to start sessions and save information as you’d like, found under Preferences–>Security:
The private browsing feature should show in your window’s title bar letting you know it is activated. With this feature enabled, you just aren’t saving anything to your cache, history etc. You are not surfing the web anonymously, however, so don’t do things you wouldn’t normally do!
iTunes Add Music Automatically from Any Folder
Posted by technohermit in Apple, iTunes, Library, OS X, Uncategorized on 2009/10/17
I’ve read a lot of posts saying Apple has no way in iTunes to automatically import music from any folder you put files into. Also, an equal number complaining there is only one folder now, in iTunes 9.
Here is a quick and easy way using Automator in OS X to do it yourself. In about forty-five hot and dirty seconds, you can create a folder action with Automator to monitor the addition of new music files for you. This folder will automatically add the new files to iTunes, convert them, and even remove the added files from the import folders. (Scroll to the end of the post for the workflow file, if you’re in a rush.)
First, open Automator. Click the Folder Actions icon:
In the next window, in the upper-right, find the drop down menu, choose a folder to receive the import action:
If you don’t have a folder created already, then just choose “Other” and in the next window you’ll be able to make one. If you do, choose “Other” and select your pre-made folder.
Next, find “Music” on the left hand column, followed by “Import Audio Files” in the right-hand column. You drag the “Import Audio Files” to the large gray area to the right, and choose an encoder for your import. See screen shots below:

That’s about all for the import. Click “File”, then “Save As”, and pick a name for your Action.
You could stop there, but you will end up with re-imports of your files as they aren’t deleted automatically on import to iTunes. So, the logical thing to do is let the folder delete them for you, by again using Automator’s built in actions. To do that, just select the “Delete Source Files After Encoding” checkbox:
Be sure to save your workflow, and you should be ready to import your music automatically using iTunes from whichever folder you chose. Still waiting on Apple for a video option, but iTunes has never been the best when it comes to playing nice with things like other’s video codecs.
In order to add this to another folder without going through Automator is easy. Just right click (or control click blech…)the folder you want to create the action on, and choose “Folder Actions Setup” in the list. It will open a list of actions for you to choose, and you will find your iTunes import action there under the name you saved it as. Select it, and you have just added it to another folder, and kept it alive on the original to boot. Beautiful.
If that was too much for you to handle, you can just download the workflow right here. Save this file to ~/Users/yourusername/Library/Workflows/Applications/Folder Actions (if the folder doesn’t exist, you may have to create it), and you should be good to go!
Update to Safari CoverFlow Webpage Preview
Posted by technohermit in Apple, OS X, Safari, Uncategorized on 2009/10/12
Ok, a quick fix if you hate CoverFlow in Safari 4 is to make the ~/Library/Caches/com.apple.Safari/Webpage Previews folder read-only like so:
Navigate to the folder, and select it. Hit Command-I.
At the bottom of the info pane, to the right of your name (Me), click where it says “Read and Write”, and change it to “Read-Only”. See screen shot below:

This doesn’t disable CoverFlow altogether, but at least it isn’t chewing up almost 50MB of disk space when you browse 10-12 websites. I guess Apple could have made them .tiff files and really screwed the pooch. I know I’ll be keeping this read-only until they make CoverFlow a choice in Safari.

























































