Monday, August 25, 2014

Copy path of file on SMB share on a Mac and convert to Windows format using Automator

I'm on a Mac. Most of my co-workers are on PCs. We store files on a network attached storage device that 'talks' Samba. I like to send links to files via email (instead of the file itself). So I need a quick way to convert the Mac/Linux file path format to the Windows format. I couldn't find it easily, and it took me several tries, so I thought I'd post the way to do it.

1) Have one of your PC colleagues send you a link to a file on the shared storage device.  It'll look something like: \\\storage\depts\org_chart.doc

2) Then look at the way that same file appears to you via terminal. Probably something like:

So, you need to substitute Volumes with\storage, and then flip the forward slashes with backslashes.

3) Open Automator. 

4) Click "New Document"

5) Choose "Service"

6) Have your Automator Window look like this (but replace insert PC path with forward slashes with company

7) Save it to something like "Copy Windows Path"

Now let's test it.

8) Use your Finder to go to the file. Control-Click (or two-finger tap) on the file, select Service, Copy Windows Path"

9) Paste it into an email.

Yay! You've made Windows users happy. Well, as happy as they could be... ;-)

Friday, August 22, 2014


Now that I have new commute down to CMU campus, I have much more time to think (and yell at traffic!). One of the things I think about is traffic.

My house is ~17 miles from work according to Apple maps. It takes my ~30 minutes to/from work in light traffic. For me to use the bussing system, it'd take 3 stops & ~90+ minutes each way, not including driving to the first stop. So, I don't take the bus.

If I had to drive to a bus stop (<15 minutes away), and could take the bus all the way to campus in a non-stop direct way, I'd do it. (It'd be good if the bus offered wifi)

It'd be possible to get a good dataset from campus garages, monitoring license plates numbers arrival & departure times. Plus, the parking system @ CMU has a reference of license plate numbers to home address. Seems like you could come up with a pretty good time-location map for suburb-to-campus-to-suburbs. Any large business downtown with a parking system could do it.

Riders would drive to various 'spots' around the city based on where they live (maybe a large church parking lot, or mall - some place with space during the workweek). A bus would be there at a specific time, load up the people, drive straight to campus/work. Reverse at end of work day.

I wonder if that kind of bussing could catch on? I think employees/faculty/staff would like it 'cause driving in rush hour stinks. CMU should like it because if it did catch on the could reduce the amount of precious campus space they dedicate to parking lots - I'm sure other businesses would feel the same. Pittsburgh should like it 'cause it reduces traffic. Oh, and it's green too.

(Update: As someone astutely pointed out, many Silicon Valley companies have chartered bus service as described, including the infamous Google Bus)

An even crazier idea:

What if the 'spots' were public schools. And instead of me driving to one, I rode the bus with my kids to school. They'd go to class, I get on the bus to CMU. (Other parents would get on the bus to UPMC,  PNC, etc.) The school busses (retrofitted with wifi) could even be used for transport. Drop the kids off, drop the parents off.

Then I wouldn't need a car during the week, & I'd get to spend more time with my kids. It could be an extra income stream for school bussing too...