Re: Inconsistent results with "do shell script"
Re: Inconsistent results with "do shell script"
- Subject: Re: Inconsistent results with "do shell script"
- From: Axel Luttgens <email@hidden>
- Date: Tue, 15 Jul 2014 10:38:54 +0200
Le 15 juil. 2014 à 09:20, Lists a écrit :
> [...]
>
> 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
>
> [...]
>
> 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
>
> Any thoughts on how to make it work every time?
Hello,
Looks like command "ln" parses a bit too lazily its source argument.
This should be circumvented by removing a trailing slash, if any, from the value of your variable QPP.
HTH,
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden