On Aug 19, 2012, at 23:38, Dr. Drang <[email protected]> wrote:
> I want to pass the contents of a document through a Unix script and use the
> result in an AppleScript, and I'm running into a line-endings problem.
______________________________________________________________________
Hey There,
BBEdit uses CRs internally, so you will always see them as EOLs in a document -
but on-disk they will be correct according to the file type. And yes this can
be confusing.
Try something like this:
------------------------------------------------------------------------------------------------
tell application "BBEdit"
set _text to text of front text document
end tell
set _text to quoted form of _text
set newText to do shell script "echo " & _text & " | tr '\\r' '\\n' | sed
's/http/•/'" without altering line endings
------------------------------------------------------------------------------------------------
Or read your input from the file rather than from the window.
--
Best Regards,
Chris
--
--
You received this message because you are subscribed to the
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem,
please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>