Logo Subtitle Subtitle

Open dual side-by-side finder with applescript

…and save as an app on your desktop!

create an app with applescript to open two finders side-by-side in a few minutes!

I use both a Mac and Windows machine and if I may compare the two, I would say one of them is my feel-good-machine and the other a workhorse to develop .NET stuff on. Both OSses have file managers which work great for finding and opening files but when you copy, move and view files all the time, doing that in the windows explorer or the Mac Finder soon becomes a click fest.

TotalCommander

On my windows machines I use the brilliant Total Commander which was very accurately described by someone as: “Using windows without Total Commander is like driving without my glasses”. It’s true. This thing can do anything from file management to comparing files and from FTP to batch copy.

Back to the Finder

When I bought my Mac I searched for Total Commander alternatives and while some of them work OK, they are not perfect. So while I wait and hope one day Christian Ghistler will re-write Total Commander for the Mac, I’m just going to use the Finder. But to copy and move files, I really need to have side by side Finders. Of course you can open two Finders but why not have an AppleScript do that for me? I googled, found this one to start from and made some changes like determining the screen size automatically and place the finders side-by-side around the center of the screen.

AppleScript to open two Finders side-by-side

STEP1: Fire up the AppleScript Editor and paste this code in it:

-- Feel free to copy, modify and redistribute this script any way you like
-- Be careful to run this "AS IS" script on your machine. I've
-- tested it and it works on my iMac but if you don't know what you're doing,
-- you could end up hurting your beloved Mac and the data on it.
-- Cheers, Loek

-- This script opens two finder windows side-by-side
property finderWidth : 900 -- MUST BE SMALLER THEN HALF OF THE ACTUAL SCREEN SIZE!
property finderHeight : 700

tell application "Finder"
	set screenBounds to bounds of window of desktop
	set screenWidth to item 3 of screenBounds
	set screenHeight to item 4 of screenBounds
	set centerX to screenWidth / 2
	set centerY to screenHeight / 2
	activate
	set visible of (every process whose visible is true and frontmost is false) to false
	set finder1 to make new Finder window
	set the bounds of finder1 to {centerX - finderWidth div 1, centerY - (finderHeight / 2) div 1, centerX - 2 div 1, centerY + (finderHeight / 2) div 1}
	set the current view of finder1 to column view
	set finder2 to make new Finder window
	set the bounds of finder2 to {centerX + 2, centerY - (finderHeight / 2) div 1, centerX + finderWidth, centerY + (finderHeight / 2) div 1}
	set the current view of finder2 to column view
end tell

STEP2: Set a correct value for the finderWidth and finderHeight and if you run the script, two Finders should open. If not, make sure the finderWidth is less then half of the actual screen width.

STEP3: Save as app

In the AppleScriptEditer goto File | Save As…

Type a name and choose Application as File Format

Open the DualFinder.app et voila! Two Finders side by side!

Open radio streams in iTunes

The Radio function in iTunes lets you browse stations but it won’t let you search for one. If you know a station that shares a music stream, you can open it directly in iTunes.

Find a stream

Google for radio streams and find playlists that end with .m3u. Copy the stream address to your clipboard.

Open in iTunes

In iTunes go to Advanced > Open stream (CMD+U) and enter the address. For your convenience, you can drag the item from the main grid to your playlists for later listening.

Eindhoven Glow 2011

This week is the 5th Glow festival in Eindhoven. Being born in the heart of Eindhoven I really enjoy seeing Eindhoven becoming more and more design and history (Philips, Light) aware and Glow is a great initiative where light and design meet. I shot this video with my Windows Phone yesterday:

More Architectural Projection

I personally like the architectural projections the most and here are some of my favorites:

http://www.youtube.com/watch?v=BGXcfvWhdDQ

http://www.youtube.com/watch?v=gE3Zg_sa0iY&feature=related

20 goto 10

I set my first steps into programming in 1984. My father bought a Philips P2000T that housed a Z80 processor, used a teletext display chip and had a mini cassette player to store and load programs.

Philips used Microsoft BASIC on their earlier released Videopac G7000 game console and used this also in the P2000. This programming language is responsible for my future love for computers. This weekend I dug up the computer from my parents basement and took it home. I was very surprised that it still worked after all these years. For old time sakes, I input my favorite statement and enjoyed the output very much:

Soon after working on the P2000T, I bought a commodore64 where I learned assembler language and really started to learn the ins and outs of computers but when I look at the P2000T, it is like looking at my first love :-)

XamlParseException occurred

I know how lost you can feel when that happens. XamlParseExceptions can be caused by a lot of things. Most of the time the troubled resource is stated in the error. But if you get the following error, what are you going to search for?

The dictionary key ” is already used. Key attributes are used as keys when inserting objects into a dictionary and must be unique.

If this error occurs, it’s possible there are implicit styles that target a type more than once. In my case I got stuck with the following code after a version control update:

<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}" />
<Style TargetType="HyperlinkButton" BasedOn="{StaticResource DefaultHyperlinkButtonStyle}" />
<Style TargetType="ComboBox" BasedOn="{StaticResource DefaultComboBoxStyle}" />

Implicit style defined twice

When I removed the second ComboBox style the error was gone. I hope this helps!