• 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: Unknown token in do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unknown token in do shell script


  • Subject: Re: Unknown token in do shell script
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 09 Mar 2012 07:59:32 -0600

On Mar 8, 2012, at 7:32 PM, Iurista GmbH wrote:

Am 09.03.2012 um 00.16 schrieb Luther Fuller:

On Mar 8, 2012, at 3:13 PM, Iurista GmbH wrote:

This works ...

property myDisk : alias "LutherFuller-2"

quoted form of (POSIX path of myDisk)
do shell script "diskutil unmount " & the result

This one works, but it needs nearly 15 seconds to do the job. Maybe it's because it adds a ":" at the end of the disk name in line 1 when compiling..???

The colon is odd. 'posix path' should remove the colon.
I just looked at this (in 10.6.8) and there is no colon.

The colon is added by the word "alias" in the property definition. I get the same result omitting this word, and then, no colon is added...

This reminded me of something I had to do in a script some years ago.
But I had forgotten where or when. A little searching revealed ...

set folderPath to (POSIX path of (folderAlias as text))
if (last character of folderPath) = "/" then
set folderPath to (text 1 thru -2 of folderPath)
end if

So, fixing the problem may be as simple as deleting the last character of a posix path.

 _______________________________________________
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

References: 
 >Re: Unknown token in do shell script (From: Iurista GmbH <email@hidden>)
 >Re: Unknown token in do shell script (From: Luther Fuller <email@hidden>)
 >Re: Unknown token in do shell script (From: Iurista GmbH <email@hidden>)

  • Prev by Date: the message app dictionary
  • Next by Date: Re: Unknown token in do shell script
  • Previous by thread: Re: Unknown token in do shell script
  • Next by thread: Re: Unknown token in do shell script
  • Index(es):
    • Date
    • Thread