troubles creating symbolic link mac to pc question

Hi
I am trying to create symbolic links in a folder, the folder where I want to
put the sym link is on a windows server, and the original folder is on a mac.

I can do this in terminal using “cd” to choose where I want to put my folder and then “ln -s”
to choose the folder I want to create a sim link of in the chosen folder with no problems at all,
yet my applescript attempt fails, the result keeps showing “”

Thought it may be required to remove the back slash from the posix path but this still does nothing

Can someone please point me in the right direction

--CHOOSE WHERE TO PUT SYM LINK
set theFolder to choose folder with prompt "Choose where you want to put the link"
set _location to POSIX path of theFolder
if _location ends with "/" then set _location to ¬
	text 1 thru -2 of _location
do shell script " cd " & quoted form of _location with administrator privileges

--CHOOSE FOLDER TO MAKE INTO SYM LINK
set theLinkFolder to choose folder with prompt "Choose folder to add as Symbolic link"
set _locationLink to POSIX path of theLinkFolder
if _locationLink ends with "/" then set _locationLink to ¬
	text 1 thru -2 of _locationLink
do shell script " ln -s " & quoted form of _locationLink with administrator privileges

cheers

If you’re running 10.9 or later:

use scripting additions
use framework "Foundation"

set newPath to POSIX path of (choose folder with prompt "Choose where you want to put the link")
set destPath to POSIX path of (choose folder with prompt "Choose folder to add as Symbolic link")
set newPath to current application's NSString's stringWithString:newPath
set destPath to current application's NSString's stringWithString:destPath
set newPath to newPath's stringByAppendingPathComponent:(destPath's lastPathComponent())
set {theResult, theError} to current application's NSFileManager's defaultManager()'s createSymbolicLinkAtPath:newPath withDestinationPath:destPath |error|:(reference)
if not theResult as boolean then error (theError's localizedDescription() as text)

Needs to go in a script library for 10.9.

SEAMLESS :smiley:

Thanks Shane poetry in motion

why wouldn’t what I have work though?, as it appears to eliminate the back slash, and call the correct posix paths

The trailing slashes aren’t the problem – your syntax is wrong.

--CHOOSE WHERE TO PUT SYM LINK
set theFolder to choose folder with prompt "Choose where you want to put the link"
set _location to POSIX path of theFolder

--CHOOSE FOLDER TO MAKE INTO SYM LINK
set theLinkFolder to choose folder with prompt "Choose folder to add as Symbolic link"
set _locationLink to POSIX path of theLinkFolder
do shell script " ln -s " & quoted form of _locationLink & space & quoted form of _location