At 22:50 -0700 21/06/2011, Warren Michelsen wrote:

When run, this warns me that Unix filters require Unix line endings and that temp.pl does not have them.

That's odd. What programme did you use to create the script? I didn't have this problem with AppleScript Editor but I can imagine Smile or Script Debugger might do this. In that case you need to force Unix line endings, like this:

--_____________
tell application "BBEdit"
  activate
  set _dd to display dialog "Type a digit?" default answer ""
  set _number to text returned of _dd
  set _appsup to "" & (path to application support from user domain)
  set _unixfilters to _appsup & "BBEdit:Unix Support:Unix Filters:"
  set _perlscript to _unixfilters & "temp.pl"
  try
    close access file _perlscript
  end try
  set _fh to open for access file _perlscript with write permission
  set eof _fh to 0
  write my SCRIPT_TEXT(_number) to _fh
  close access _fh
  run unix filter alias _perlscript
end tell
on SCRIPT_TEXT(_n)
  set _lf to ASCII character 10
  set _s to "#!/usr/bin/perl
my $n = qq~" & _n & "~;" & "
while (<>){
  s/$n/<$n>/g;
  print;
}"
  set _paras to paragraphs of _s
  set AppleScript's text item delimiters to _lf
  set _s to _paras as string
  set AppleScript's text item delimiters to {""}
  return _s
end SCRIPT_TEXT
--_____________


--JD

--
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>

Reply via email to