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

mattspace

macrumors 68040
Original poster
Jun 5, 2013
3,329
2,965
Australia
Hi,

So, for reasons, I'm experimenting with trying to add a symlink to /Volumes, to a specific location on a machine which has a name with spaces in it.

Code:
sudo ln -s /Users/admin/Documents/a\ test\ folder/destination /Volumes

Since /Volumes is wiped every boot, I wanted to create a script to run at login, and I found Automator tutorials for it, except it's tripping up on the backslashes and spaces in the paths, and everyone I've found online trying to solve his, is using examples that are so complicated I can't understand the salient information.

So would anyone mind just addressing from my example above, how I can get Automator / Applescript to parse those backslash and space bits as part of the path, rather than a "unknown token"?

Thanks.
 

mattspace

macrumors 68040
Original poster
Jun 5, 2013
3,329
2,965
Australia
Nevermind, I found a solution deep in an answer to an unvoted comment... just needed to replace the single bckslash with a double backslash.
 

SecuritySteve

macrumors 6502a
Jul 6, 2017
949
1,082
California
Nevermind, I found a solution deep in an answer to an unvoted comment... just needed to replace the single bckslash with a double backslash.
Interestingly, if you ever do coding with Obj-C or Swift, the double backslash issue/solution pops up there too. Found that out while writing regex for an application.
 
  • Like
Reactions: mattspace
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.