Mime-Version: |
1.0 (Apple Message framework v752.2) |
Content-Type: |
text/plain; charset=US-ASCII; delsp=yes; format=flowed |
Date: |
Mon, 25 Sep 2006 09:20:10 +0900 |
Reply-To: |
|
Subject: |
|
From: |
|
In-Reply-To: |
|
Content-Transfer-Encoding: |
7bit |
Sender: |
|
Parts/Attachments: |
|
|
Hello Philip,
On Sep 23, 2006, at 12:37 PM, Philip Aker wrote:
> On 2006-09-22, at 20:33:00, Philip Aker wrote:
>
>> On 2006-09-22, at 18:54:50, Nobumi Iyanaga wrote:
>>
>>> Perhaps I may use something like:
>>
>>> do shell script "perl -e '$_ = shift; print'" & space & quoted
>>> form of the_text & space & "| ..."
>>
>> Hi Nobumi,
>>
>> With perl, watch for semicolons to end a statement:
>> do shell script "perl -e '$_ = shift; print;
>
> But maybe that's not it. Perhaps you have '\r' in you files? If so
> then maybe you'll have to convert them to '\n'.
>
> Also 'echo -n' will not insert the extra newline on output.
Thank you for your reply.
I tried with a large text (more than 18000 characters) this script:
tell application "Nisus Writer Express"
set the_text to selected text of front document
end tell
do shell script "echo" & space & quoted form of the_text & space &
"> ~/Desktop/testtext.txt"
This seems to work without problem -- although it adds a
supplementary LF at the end of the file.
Other commands:
do shell script "perl -e '$_ = shift; print;'" & space & quoted form
of the_text
or
do shell script "printf" & space & quoted form of the_text
do work as well, and don't add the supplementary LF at the end.
Thank you again.
Best regards,
Nobumi Iyanaga
Tokyo,
Japan
|
|
|