Finder 'open location' with a space in the folder name

I’ve made a droplet to quickly and easily transfer files between my computers. All that is working great! I would like to add a function whereby when the app is clicked open, the Drop Box folder on the networked computer is opened. The problem I’m having is the space in the Drop Box folder name. The script opens any folder without a space in the name. I realize I can just ‘do shell script’ it, but I’m stubborn.

Can someone please point out the correct way to escape the space in the folder name so it works with Finder’s ‘open location’ command?

This shell script works:


do shell script "open ./Volumes/username/Public/Drop\\ Box"

This works, too:


tell application "Finder"
	activate
	open location "afp://10.0.1.2/username/Desktop"
end tell

This doesn’t work:


tell application "Finder"
	activate
	open location "afp://10.0.1.2/username/Public/Drop Box"
end tell

Nor does this:


tell application "Finder"
	activate
	open location "afp://10.0.1.2/username/Public/Drop\\ Box"
end tell

Now, I know what you’re thinking: Just use the working shell script version. That’s not the point. Like I said, I’m stubborn. I want to know how to do it with Finder.

Thanks in advance.

Model: iMac
AppleScript: 2.0.1
Browser: Safari 525.27.1
Operating System: Mac OS X (10.5)

Try:

Drop%20Box

Peter B.


Well that sure was simple. And it makes total sense. I clearly wasn’t thinking it through all the way.

Note to self: A URL is a URL.

Thanks Peter

Ryan