Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

punzai

macrumors newbie
Original poster
Nov 6, 2007
9
0
Hello,

I've been using Macs for a good 6 years now and it's been great. :)

However, I have a question that doesn't appear to have a satisfactory answer anywhere on these boards or on the net.

I work at a large company doing art. We have recently upgraded some of our teams to Macs. I am one of them.
We regularly send each other emails with links to art on the network. We copy the address in the windows explorer path window and paste that address into the email.

For example, a typical path would look something like this:

\\Server\share\Art\Game\FolderOfArt\PNGs

And that becomes a nice clickable link in Outlook.

Sadly, there doesn't appear to be an easy way to do this using Mac OS X. You just end up with something like this:

/Volumes/Share/Art/Game/FolderOfArt/PNGs

This then has to be edited before a PC can do anything with it.

As you can imagine, this is just a little frustrating.

The IT dept. don't have a satisfactory answer either.

I thought I'd ask here as you guys tend to be extremely knowledgeable about all things Mac OS. :)
 
One solution could be a little application on your Windows computers that allows you to copy/paste a Mac path and then automatically converts it and navigates to it for you.

On the Mac side, perhaps an Applescript could be written that does the conversion of copy/pasted path allowing you to paste in the PC version into an email.

I don't know enough Applescript to write that, but I think I might whip up a PC app to test out my idea.
 
Thanks very much. That link really helped. I've got a viable solution now.

Created an automator service that does the trick. :)
 
Got a wild hair to solve this problem since it's been bugging me… first, I'll recap, then provide a solution +:

PROBLEM
From a Mac, I want to copy a file path on a network share into an email so that its clickable by poor Windows recipients. Currently, I copy/paste the path, e.g.:
smb://servername/MLS/Timbers/IrrefutableProofTimbersAreBestTeamInMLS.pdf

into an email, then manually convert it to a Windows path:
\\servername\MLS\Timbers\IrrefutableProofTimbersAreBestTeamInMLS.pdf

But that’s a stupid thing to do over and over, so I found some examples online (this forum and others) and hacked it until I got it to work a few ways (see below).

A related problem is when Windows users send me a file path and I want to quickly access it. Currently, I manually navigate to it by translating the path in my little head, which hurts. So, I reversed the hack above and added a call to open the folder to the file.


SOLUTION
In Mac OS Automator I created three Apple scripts that run as a service. This enables me to select a path, right-click and choose the appropriate service from the “Services…” menu, which I named:
“Convert Windows to Mac path and open it”
“Convert Windows to Mac path”
“Convert Mac to Windows path”

ConvertingMacToWindowsPath-InAction-Timbers.png



DETAILS

Script: “Convert Windows to Mac path and open it”

on searchReplace(theText, SearchString, ReplaceString)
set OldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to SearchString
set newText to text items of theText
set AppleScript's text item delimiters to ReplaceString
set newText to newText as text
set AppleScript's text item delimiters to OldDelims
return newText
end searchReplace


on run {input, parameters}
set myClip to the input
set mytext to searchReplace(myClip, "<", "")
set mytext to searchReplace(mytext, ">.", "")
set mytext to searchReplace(mytext, ">", "")
set findIt to "\\"
set replaceIt to "/"
set mylocation to searchReplace(mytext, findIt, replaceIt)
set mylocation to "smb:" & mylocation
tell application "Finder"
open location mylocation
end tell
return input
end run

-- Thanks to: http://apple.stackexchange.com/ques...path-structure-using-automator-windows-to-mac --



Script: “Convert Windows to Mac path”

on searchReplace(theText, SearchString, ReplaceString)
set OldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to SearchString
set newText to text items of theText
set AppleScript's text item delimiters to ReplaceString
set newText to newText as text
set AppleScript's text item delimiters to OldDelims
return newText
end searchReplace


on run {input, parameters}
set myClip to the input
set mytext to searchReplace(myClip, "<", "")
set mytext to searchReplace(mytext, ">.", "")
set mytext to searchReplace(mytext, ">", "")
set findIt to "\\"
set replaceIt to "/"
set mylocation to searchReplace(mytext, findIt, replaceIt)
set mylocation to "smb:" & mylocation
return mylocation
end run



Script: “Convert Mac to Windows path”

on searchReplace(theText, SearchString, ReplaceString)
set OldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to SearchString
set newText to text items of theText
set AppleScript's text item delimiters to ReplaceString
set newText to newText as text
set AppleScript's text item delimiters to OldDelims
return newText
end searchReplace

on run {input, parameters}
set myClip to the input
set mytext to searchReplace(myClip, "<", "")
set mytext to searchReplace(mytext, ">.", "")
set mytext to searchReplace(mytext, ">", "")
set mytext to searchReplace(mytext, "smb://", "\\\\")
set findIt to "/"
set replaceIt to "\\"
set mylocation to searchReplace(mytext, findIt, replaceIt)
return mylocation
end run



Screenshots of the scripts:


AppleScript-ConvertWindowsToMacPathAndOpenIt.png


AppleScript-ConvertWindowsToMacPath.png


AppleScript-ConvertMacToWindowsPath.png
 
  • Like
Reactions: neeklamy
Hello
Thank you all for the useful informations you provided.

Unfortunately I could not use these scripts.
I don’t know where the problem is.
I want to convert these addresses together:

Windows path:
\\pdc\PGt Razor\PGt Advertising\Accounts\E.jpg
and
T:\PGt Advertising\Accounts\E.jpg

to

Mac os path:
smb://pdc/PGt Razor/PGt Advertising/Accounts/E.jpg


Can anyone guide me?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.