• 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: Yvan KOENIG <email@hidden>
  • Date: Mon, 13 Mar 2017 10:10:39 +0100


Le 13 mars 2017 à 01:04, debt <email@hidden> a écrit :
…

The only downside to this is that the Perl script needs to be opened and read every single time the AppleScript is run.  I really don’t like that, but at this point I don’t see another alternative.  Plus, right now I’m reading the entire file into the document_contents variable.  Is there a way to read only the first line and nothing more?

Thanks,
Marc


You may try :

set the_perl_script to (path to desktop as text) & "code:perl:test.pl"
set shebang to (read file the_perl_script before linefeed)
set shebang to paragraph 1 of document_contents
set path_to_perl to characters 3 thru -1 of shebang as text

do shell script path_to_perl & space & quoted form of the_perl_script & space & parameters

Before doing that, check your file to see if line breaks are defined by linefeed characters or if they are defined by return ones.


Yvan KOENIG running Sierra 10.12.3 in French (VALLAURIS, France) lundi 13 mars 2017 10:10:33



 _______________________________________________
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: Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers
  • Next by Date: Re: collectdata
  • 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