• 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: Differences in output between AppleScript and Terminal
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Differences in output between AppleScript and Terminal


  • Subject: Re: Differences in output between AppleScript and Terminal
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 12 Mar 2017 19:54:01 -0500

On Mar 12, 2017, at 19:04, debt <email@hidden> wrote:
I understand and agree with the premise, *however* I think we should be able to mimic the Terminal if we want to, but I haven’t found a way to do that.


Hey Marc,

I thought I just showed you how with source yourBashProfileFile – which loads up your current environment into the AppleScript do shell script session.

All I have to do is read the first line of the Perl script to grab the shebang line and then use that in the AppleScript.  WooHoo!  Problem solved.

That seems a trifle overly complicated.

---------------------------------------------------------------

tell application "System Events"
    set perlScriptPath to POSIX path of disk item "~/Downloads/test.pl"
end tell

set perlParams to "one two three"

do shell script "source ~/.profile
" & quoted form of perlScriptPath & space & perlParams

---------------------------------------------------------------

Provided your Perl script is marked executable this should work every time, and you can change the shebang line as you see fit.

--
Best Regards,
Chris

 _______________________________________________
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: Differences in output between AppleScript and Terminal
      • From: debt <email@hidden>
References: 
 >Differences in output between AppleScript and Terminal (From: debt <email@hidden>)
 >Re: Differences in output between AppleScript and Terminal (From: debt <email@hidden>)
 >Re: Differences in output between AppleScript and Terminal (From: Christopher Stone <email@hidden>)
 >Re: Differences in output between AppleScript and Terminal (From: debt <email@hidden>)

  • Prev by Date: Re: Differences in output between AppleScript and Terminal
  • Next by Date: Re: Question on keywords
  • Previous by thread: Re: Differences in output between AppleScript and Terminal
  • Next by thread: Re: Differences in output between AppleScript and Terminal
  • Index(es):
    • Date
    • Thread