Copying a path name from mac to pc

Discussion in 'macOS' started by punzai, May 24, 2011.

  1. punzai macrumors newbie

    Joined:
    Nov 6, 2007
    #1
    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. :)
     
  2. mrgraff macrumors 6502a

    mrgraff

    Joined:
    Apr 18, 2010
    Location:
    Albuquerque
    #2
    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.
     
  3. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
  4. punzai thread starter macrumors newbie

    Joined:
    Nov 6, 2007
    #4
    Thanks very much. That link really helped. I've got a viable solution now.

    Created an automator service that does the trick. :)
     
  5. mdeniston macrumors newbie

    mdeniston

    Joined:
    Mar 12, 2017
    Location:
    Portland, Oregon
    #5
    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”

    [​IMG]


    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:


    [​IMG]

    [​IMG]

    [​IMG]
     

Share This Page