I use a mac at work and people send me windows file paths all day. Does anyone know how to convert the filepath using applescript in an automator so I can right click in an email and then open it?

Windows path: \\Sfa66\devmrkdt$\Donor Relations\FY14\Events\Invitation\Email

Mac path: smb://Sfa66\devmrkdt$/Donor Relations/FY14/Events/Invitation/Email

This answer was so close How to translate between Windows and Mac -style file locations? but it won't work when there are blank spaces in the file path.


Blank spaces have to be escaped. To escape a special character, like a blank space, you use a forward slash, so " " will become "\ ".

You can modify the script, https://gist.github.com/2211017, link to from the post you linked to by adding the following line set mytext to searchReplace(mytext, " ", "\ ") after line 16.

15. set mytext to searchReplace(mytext, ">.", "")
16. set mytext to searchReplace(mytext, ">", "")

17. set mytext to searchReplace(mytext, " ", "\ ")

18. set findIt to "\\"
19. set replaceIt to "/"

I created three Mac automator scripts based on internet code snippets for task of this question. Enjoy.

URL: https://github.com/marcoziti/mactoys

  • 2
    Welcome to Ask Different! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Glorfindel Mar 1 '18 at 10:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .