• 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: Getting pid and error from do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting pid and error from do shell script


  • Subject: Re: Getting pid and error from do shell script
  • From: Luther Fuller <email@hidden>
  • Date: Tue, 26 Dec 2006 11:53:45 -0600


On Dec 26, 2006, at 10:56 AM, David Simerly wrote:

On 12/23/06 1:47 PM, "Luther Fuller" <email@hidden> wrote:

My problem is that I also need to get a pid from the second script if
the user does NOT click Cancel. I have read TN2065 "do shell script
in AppleScript" for the third time, but it offers no understanding of
this problem. (It recommends that I "See the sh man page under
"Redirection" for more details." ... but there is no man page for sh!)

Well, first, if the hdiutil returns the pid, then it will be returned by do shell script. So you can do something like:


set the_pid to do shell script quoted form of ( "hdiutil convert " & inFile & " -format UDZO -encryption -o " & outFile )

Not having scripted hdiutil in several years, I don’t recall whether this will work.

It won't work. First, you need the & " &> /dev/null & echo $!" to return a pid. Second, the pid is returned immediately, and without error, after "do shell script ...", allowing my script to proceed while the dialog displayed by "-encryption " is still showing.


The solution, if possible, is to combine the pid and error code into a single result that is returned AFTER the user clicks "Cancel" or "OK" in the hdiutil encryption dialog. My AppleScript code would then read the result and act accordingly.



_______________________________________________
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/mailman//archives/applescript-users

This email sent to email@hidden
References: 
 >Re: Getting pid and error from do shell script (From: David Simerly <email@hidden>)

  • Prev by Date: Re: Getting pid and error from do shell script
  • Next by Date: Re: Replace all caps into plain
  • Previous by thread: Re: Getting pid and error from do shell script
  • Next by thread: AS Studio - How - CkBoxes in Table View Column ?
  • Index(es):
    • Date
    • Thread