• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Inconsistent results with "do shell script"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Inconsistent results with "do shell script"
      • From: "koenig.yvan" <email@hidden>
    • Re: Inconsistent results with "do shell script"
      • From: Emmanuel LEVY <email@hidden>
References: 
 >Inconsistent results with "do shell script" (From: Lists <email@hidden>)

  • Prev by Date: Re: Eject Bootable Clone
  • Next by Date: Re: Inconsistent results with "do shell script"
  • Previous by thread: Inconsistent results with "do shell script"
  • Next by thread: Re: Inconsistent results with "do shell script"
  • Index(es):
    • Date
    • Thread