Re: Differences in output between AppleScript and Terminal
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
…
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