• 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: How to Run a "sudo" Terminal Command
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Run a "sudo" Terminal Command


  • Subject: Re: How to Run a "sudo" Terminal Command
  • From: "S. J. Cunningham" <email@hidden>
  • Date: Sun, 13 Dec 2015 05:05:22 -0500

On Dec 12, 2015, at 7:24 PM, Paul Scott wrote:

> More generally, if you want to execute any binary or arbitrary language script, and capture and display all its output, you’d want this:
>
> on open parms
> 	set ListOfFiles to {}
> 	repeat with f in parms
> 		display dialog (do shell script "\"" & (POSIX path of f) & "\"")
> 	end repeat
> end open
>
> You could also check to see if the output was empty and avoid the display dialog. An infinite number of improvements are possible. I’ll be quiet now.
>
> Paul
>

Thanks for the suggestions and examples Paul.  I was aware that I could do this using Applescript but you certainly clarified my understanding.  I was, however, wondering if there were not a way to create a text shell script, mark it executable, and execute it directly without having to resort to an intermediate application like Applescript or BBEdit to avoid the terminal popping up.  From the chirping crickets, I'm guessing there isn't :)

Steve
------------------
OS X 10.6.8, AppleScript 2.1.2


 _______________________________________________
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: How to Run a "sudo" Terminal Command
      • From: Christopher Stone <email@hidden>
References: 
 >How to Run a "sudo" Terminal Command (From: Dave <email@hidden>)
 >Re: How to Run a "sudo" Terminal Command (From: "S. J. Cunningham" <email@hidden>)
 >Re: How to Run a "sudo" Terminal Command (From: Yvan KOENIG <email@hidden>)
 >Re: How to Run a "sudo" Terminal Command (From: "S. J. Cunningham" <email@hidden>)
 >Re: How to Run a "sudo" Terminal Command (From: "S. J. Cunningham" <email@hidden>)

  • Prev by Date: Re: AS Library Question
  • Next by Date: Re: How to Run a "sudo" Terminal Command
  • Previous by thread: Re: How to Run a "sudo" Terminal Command
  • Next by thread: Re: How to Run a "sudo" Terminal Command
  • Index(es):
    • Date
    • Thread