Here is the script and the two logs for comparison.
set targFile to choose file
set QPP to quoted form of POSIX path of targFile
set targFolder to "~/Desktop/"
set shellScpt to "ln -s " & QPP & " " & targFolder
do shell script shellScpt
This works as expected with a video file in a folder on the desktop. For example, the result of successful run:
tell application "AppleScript Editor"
choose file
--> alias "Sox:Users:j:Desktop:videos:207731393.mp4"
end tell
tell current application
do shell script "ln -s '/Users/j/Desktop/videos/207731393.mp4' ~/Desktop/"
--> ""
end tell
Result:
""
The link was created
This same script however fails when I choose an application in my user application folder. This is the result of a failure:
tell application "AppleScript Editor"
choose file
--> alias "Sox:Users:j:Applications:Apps-Games:Adapter.app:"
end tell
tell current application
do shell script "ln -s '/Users/j/Applications/Apps-Games/Adapter.app/' ~/Desktop/"
--> error "ln: /Users/j/Desktop//: File exists" number 1
Result:
error "ln: /Users/j/Desktop//: File exists" number 1
The link was not created