Re: Searching for files of a particular line break type

2013-07-29 Thread Doug McNutt
ftp://macnauchtan.com/Software/LineEnds

Is a link to an older Applescript  scheme, with a bit of C code, that allows 
for a quick study of existing files by dropping their icons onto a folder.  
It's a bit old (2006) and I can't test with anything newer than OS 10.4.

It is not intended to handle searching for a plurality of files but it does 
count the number of each kind of line ends and display the results for files 
passed one at a time.  It can also change line ends but only for resulting 
files that will work with strictly one kind of line end after a change.

Personally I keep running into files that have good reasons for using different 
line ends in different places. It's hard to find an editor that will help much 
with those.

-- 
--A flashlight: is a metal tube used to store dead dry cells. --

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit

--- 
You received this message because you are subscribed to the Google Groups 
BBEdit Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.




Re: Strip away all HTML, leaving just the URLs

2013-03-07 Thread Doug McNutt
At 10:14 + 3/7/13, John Delacour wrote:
On 06/03/2013 15:58, Nick wrote:

Thanks, that did exactly what I was looking for. But, I realized I also need 
to do this for anchor tags with relative links, such as:
a href=/xxx//zzz.shtmlordinateur de bureau/a

A text filter something like this should do everything you want provided you 
haven't got more than one URL per line.

#!/usr/bin/perl
use strict;
my $f = /tmp/url.txt;
open my $fh, , $f or die $!;
while () {
/href ?= ?([^]*)/ and print $fh $1\n;
   print;
}
`open -a bbedit $f`;


The link at the top starts with a slash meaning it's a complete URI.  But mots 
links on a site will not be like that. They will have an implied BASE as a 
starting point.  It might be the initial URL that got you to the site or it 
might be explicitly set in the HTML code.  You will need to save that 
information and apply it to the list of links you're getting.  That's not 
usually what a text editor is expected to do.

-- 
--A flashlight: is a metal tube used to store dead dry cells. --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit

--- 
You received this message because you are subscribed to the Google Groups 
BBEdit Talk group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: UI feature request: Tabs

2012-12-31 Thread Doug McNutt
Why don't you folks who want tabs just use a bbedit worksheet?

I rarely use Finder these days and I never open a bbedit slide drawer.

What I do is to always have a bbedit worksheet open on my leftmost monitor.  In 
it are shell scripts that I can select and click any time I want. They are 
easily arranged in groups and I can call files by whatever name I want. It's 
easy to arrange a series of shell commands that open all the files I want be 
they bbedit or something else. I can also tell a browser to open a bbedit 
html file.

The bbedit tool is useful but so is osascript which allows for short 
AppleScripts that works pretty will with bbedit when you want to search for 
stuff..

Just set up a worksheet and make it a window size you like. Your tabs can be 
simple names in the order you want. Click on one and bbedit will do what you 
ask for and could easily just open, or perhaps save and close the tab that 
you want.

Actually I do a lot of work with gedit which defaults to opening a new tab when 
another file is already open.  Fortunately I can simply drag the tab over to 
another monitor to get two real windows as I want.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Overtype is there such a thing?

2012-12-20 Thread Doug McNutt
At 16:17 -0600 12/20/12, Fritz Anderson wrote:
On 20 Dec 2012, at 3:36 PM, LuKreme krem...@kreme.com wrote:

 Wouho Otus spake on Thursday 20-Dec-2012@03:02:09
 Is there an overtype option for BBEdit?
 
 Select the text you want to overtype and type the new text.
 
 ?

The OP is thinking of the ability to take a line that is, say, in the format 
of a FORTRAN card, click in the line-number field, and type a new number over 
the existing contents without spoiling the column alignment of the rest of the 
line. I wouldn't use it, but it's not a crazy requirement. I know TextMate has 
an overtype mode (which is distressingly easy to get into accidentally), and 
I'm sure others do, too.

I know of no such mode, and no obvious search of the BBEdit manual turns it 
up. Unless this is another of those features that have been in the app for 
twenty years and nobody noticed.


Another, once common, feature  was the ability to send letter O, backspace, 
slash and expect to see a phi.

There is also the possibility of sending a carriage return without a line feed 
followed by a second line of type, which might be some underline characters,  
and a line feed.

bbedit doesn't understand either one. It's a bit like talking to a teenager 
about WW II (or FORTRAN).

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Mixed line endings problem

2012-12-11 Thread Doug McNutt
At 21:00 -0800 12/10/12, Gregory Shenaut wrote:
It seems to me that a file with mixed line endings should be interpreted such 
that \r sends the carriage back to first column but doesn't advance to the 
next line, with \n serving to move down one in the same column: in other 
words, a file intended for a printer. In that world, only DOS-style \r\n will 
work as a line-end per se. Or, to generalize this a little, in a file 
containing both \r and \n characters, those characters should assume their 
ASCII significance, with \r\n counting as a line ending. In files with \r but 
not \n, use \r as line-end; in files with \n but not \r, use \n as line-end.

You're showing your youth!

I can remember a time when those line ends did exactly what you say.  The 
machine is called an ASR33 teletype or, later, a Flexowriter (TM) where you 
could personalize letters to lots of people..

One could send a CR and retype the same line. That allowed for a version of 
bold emphasis or a way to make a phi out of an O by adding a / character on the 
second pass. You could also underline stuff.

An interesting feature was that one needed to send returns and line feeds in 
the right order for the destination machine and some nulls were needed to allow 
for the required motions to occur before the next character to be printed.

Other control characters, pretty much ignored today, were used to shift to 
upper case or to numerics with 6, or even  5, bits per byte.

What was really fun was sending lines to a Control Data line printer where you 
could have a whole line reprinted as many times as you want before sending a 
line feed. I still have a calendar for something like 1965 that includes the 
Playboy centerfolds done that way. The code depended on carefully worked tables 
of the density of overprinted pairs of characters.

My machines expect RS232 line feeds and returns and do things like that today. 
BBEdit just cannot be used. Perl is the way to go but don't even think about 
debugging code with BBEdit as the viewer for the output as well as for the 
source code being edited..

And. . . Do you know that, in the Apple world \r is supposed to be equivalent 
to 0A and \n is a 0D? That was observed in the day when MPW was the way to go 
but it made it into some IETF standards and hasn't been removed even though OS 
neXt with it's NEXT, Inc origins doesn't follow that standard.

-- 

--  Halloween  == Oct 31 == Dec 25 == Christmas  --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Mixed line endings problem

2012-12-11 Thread Doug McNutt
At 09:40 -0500 12/11/12, François Schiettecatte wrote:
Ok, obviously an issue for you, have you filed a report with Bare Bones 
Software Technical Support @ supp...@barebones.com ?

Perhaps not, but I sure have.  It started pretty much with the introduction of 
worksheets which I really hoped would be a replacement for MPW which Apple 
killed with OS 10.

BBEdit 6.5 on this Mac 8500 works pretty well.  The newer stuff I see as a 
violation of the bare-bones concept and I expect to be declared persona non 
grata on this list any time now.

-- 
-- Marriage and kilo are troubled words. Turmoil results when centuries-old 
usage is altered in specialized jargon --.

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Mixed line endings problem

2012-12-10 Thread Doug McNutt
At 17:51 -0800 12/10/12, Troy Gillette wrote:
I work on a large cross-platform project for Mac and Windows. Every editor 
used on the Windows team treats UNIX and Windows style line endings as if it 
is simply a native carriage return. So if any mixed line endings end up in a 
file, it is completely transparent.

Xcode, TextMate and even TextEdit on the Mac do the same thing.

BBEdit on the other hand, looks at the first line of the file and assumes ALL 
other line endings in the file match that one. So, if you open a file with a 
UNIX line ending on the first line, any lines with Windows EOLs will end up 
with a second empty line after them and if the first line is Windows style, 
any UNIX lines will get mushed together into a single line.

The only way I see to fix this is to make the entire file conform to one or 
the other. This can be a real pain, especially if only the first few lines are 
different because it will mess up everything after that (I see no way to force 
bbedit to load one way or the other, it always chooses for me). It also 
results in excessive/unnecessary changes in revision control.

I understand there are times when you would want to be able to know there are 
differing line endings, but the current system makes life difficult for those 
of us who must cooperate with developers outside of the Mac world.

Is there a chance that we could have a preferences option to make BBEdit 
behave like every other developers editor on the market?
Is there already such an option that I just can't seem to find?

I feel your pain.

BBEdit's editing procedure demands that line ends all be the same while 
displayed in an editing window. They are converted as desired to the output 
format on a save or when a copy is put onto the system clipboard.  Linux' gedit 
has pretty much the same problems. Nisus for OS 9 is nice but unsupported and 
the neXt version is too different. Simpletext is a solution of sorts but only 
on classic machines.  VI... . . Naah.

Have a close look at the format of a BBEdit worksheet.  It's actually an Apple 
*.plist file and the guts of the content is a single binary entry that's buried 
in a cell of the underlying XML.  The XML uses 0A line ends and the binary 
data is the worksheet. with its 0D endings.

You cannot edit a bbedit worksheet using the bbedit editor.

I work with strange electronic devices like oscilloscopes and digitally 
controlled power supplies and other machinery.  Some of it actually requires 
different kinds of line ends but the ends are simply never the same so there is 
no way to prepare a report in BBEdit that needs to contain samples of code or 
measured data.

ftp://macnauchtan.com/Software/LineEnds/ contains some AppleScripts that I 
think will still work to repair files with divers ends. I'm stuck, though, at 
10.3.9 because Tiger refused to honor my SE/30 file server and newer Macs won't 
talk RS232 to my machinery.

God help the world when the two new UTF-16 line ends, soft and hard, that now 
exist, become popular.

And long live Apple's MPW which can edit its own worksheets and then execute 
them by name.

And I also want tab stops that work like my Olympia typewriter or an 026 
keypunch.
-- 

   Fe++
//  \
Fe++  Fe++
  |   ||
Fe++  Fe++
   \\/
   Fe++

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Web hosting recommendations

2012-12-06 Thread Doug McNutt
At 20:57 -0800 12/5/12, Govinda wrote:
+1
Pair gives you SSH and also use git... in even the basic plan.

I totally agree.  pair gives you a bonafide UNIX login which works nicely with 
a BBEdit worksheet.

It's easy to set up reusable bash or tcsh command lines that use SCP to allow 
local editing of stuff stored at pair. You can create a ,ssh directory at pair 
and populate it with your public RSA code in authorized_keys. No other log in 
needed after that.

But how did this thread get started? The original seems to have been a posting 
to JavaMail.geo-discussion-forums@ynep10

-- 
1801 - Joseph Marie Jacquard uses punch cards to instruct a loom to weave 
hello, world into a tapestry.

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Using Applescript to run GNU Make

2012-11-29 Thread Doug McNutt
At 20:19 -0800 11/28/12, Randall Venhola wrote:
I have been reading the BBEdit User Manual and I am stuck.My goal is to have 
the output of my GNU Makefile to become a clickable results browser. I have 
tested the Makefile and it works fine. I open the Applescript editor and then 
open the BBEdit dictionary. Then I start writing a script. I get this far:


tell application BBEdit

   run unix script build_myapp.sh

end tell


I created build_myapp.sh and put it on my PATH. It verified that it properly 
invokes GNU make with the command line parameters I want.

I compile the script and drop in the BBEdit scripts folder. It shows up in the 
Scripts menu. I try to run it and I get this error message:

BBEdit got an error: An error of type 13304 has occurred. number 13304


So the above error message is problem 1.

Problem 2 is how do I re-direct the output to a results browser? I'd like the 
compiler errors to show up so that I can click on them.


Almost surely the application BBEdit was not started up from within from your 
UNIX login application - Terminal.app zB.

Apple's OS does not handle $PATH changes in a .profile or the like when 
applications such as BBEdit are started from Finder.  Everything demands full 
path names and every shell command issued will bring up a new shell to execute 
it after it removes any $PATH mods you previously made, even in the same 
Applescript.

BBEdit worksheets help a bit and you could use the osascript tool to run your 
script fro a command line in a worksheet.  I'm stuck on OS 10.3.9 because I 
refuse to give up my SE/30 file server so my BBEdit worksheets are likely not 
current. With that caveat, ftp://ftp/macnauchtan.com/Software/BBEdit/ has 
some hacks I use to make worksheets work more like MPW with environment 
variables that are sticky.

-- 

--  Halloween  == Oct 31 == Dec 25 == Christmas  --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Unix scripts not working in 10.8.2

2012-10-06 Thread Doug McNutt
At 21:53 +0100 10/6/12, John Delacour wrote:
On 05/10/2012 20:52, François Schiettecatte wrote:
Dumb question, have you checked that the script has execute permissions?
  chmod 755 myScript.pl
I've explained why the scripts weren't working, and it has nothing to do with 
permissions. A script does not need to be executable in this environment.

JD

That's interesting.

Does bbedit read and translate the shebang line then? What about

#!/usr/bin/myspecialbinary

Would bbedit execute my compiled code in $HOME/bin if I tried to run it as a 
bbedit script?  What about

#!/Users/doug/bin/tcsh   ?

Or does the script have to be written in perl?
-- 

--  Halloween  == Oct 31 == Dec 25 == Christmas  --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Unix scripts not working in 10.8.2

2012-10-05 Thread Doug McNutt
At 20:43 +0100 10/5/12, John Delacour wrote:
I installed Mountain Lion yesterday, probably the worst decision I ever made! 
Some of Apple's own main apps now seem to be buggier than they were 5 years 
ago with no useful new features.

None of my UNIX filters in BBEdit are now working.

For example this script

#!/usr/bin/perl
while () {
print * $_
}

should put an asterisk at the beginning of each line in the front document but 
nothing happens at all with this script or any other.

Mountain Lion has caused me so much trouble that I'm now exhausted, so perhaps 
I'm missing something obvious.

Any help out there?

JD

You might need a semicolon after the print, But it is the last line between {}s 
so whonoze?

Apple thinks UNIX users are out to destroy their machines.

Others, in the SciTech area, have reported that  many UNIX executables have 
been moved from /usr/bin/ to something like /usr/share/bin/... though Apple 
itself uses perl so perhaps not.

Check which perl top see if a usable perl is found with your $PATH and your 
path might not be what you think when calling from within bbedit.


-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Reading Data from Text Window into a Shell Worksheet

2012-09-22 Thread Doug McNutt
At 04:54 -0500 9/22/12, Christopher Stone wrote:
Today I was prototyping some shell stuff for an Applescript, which I sometimes 
do in a BBEdit worksheet due to the extra quoting necessary in Applescript.  I 
like to get it working before I have to futz with the quoting.

Anyway.  Today I didn't feel like bothering to save my test data to a file and 
working from that, so I thought there has to be a better way...

I thought about using text from an unsaved window, and after a few minutes of 
wrestling to get the syntax right I came up with this:

WIN=untitled text 11
echo -e tell application \BBEdit\\nreturn text of text window \$WIN\\nend 
tell 21 | osascript \
| tr '\r' '\n' \
| awk '/src=.+\.jpg/ { print }' \
| sed -En '/a href=.+nyet/{
s/.+(http:.+\.jpg).+/\1/p
}'

I thought the general principle might be of use to someone, and I'm interested 
in better ways to accomplish this task if there are any.


Have a look at shell tools pbcopy and pbpaste.  They can copy stdin into the 
clipboard and copy the clipbnoard to stdout.

I miss them on my Linux box.

date | pbcopy
cat  somefile | pbcopy
pbpaste | tcsh

Are a particularly useful things to keep around in a bbedit worksheet.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Grep and Line Endings

2012-08-22 Thread Doug McNutt
At 13:50 -0600 8/21/12, Clark Goble wrote:
About the use of 0x0D while editing ALL fioes.

It would seem if you do want to make this a feature in the future simply have 
a filter function you run the grep text through before passing it to your grep 
functions. In that filter function simply replace '\n' with '\r'. Then expose 
a checkmark in the Preferences that turns this filter's use on or off. I bet a 
lot of people would appreciate it. 


There still is a BBEdit worksheet in the Bare Bones offerings. I'm still on OS 
10.3.9 because of my SE/30 file server and that means I may miss some changes 
here.

I run all kind of filters on documents that are open in bbedit worksheets. UNIX 
grep, sed, and homemade perl scripts that read new data from serial ports, for 
instance.  One has to be sure the document has been saved. After that you 
select a few contiguous commands previously stored in the worksheet and poke 
ENTER.  They operate on the text file as it appears in its stored state. When 
the operations terminate the bbedit application notices that the file has 
changed and politely offers to update the editing image in its UNICODE-16 
format.

The one frustration that I have is that worksheets do in fact use 0x0D line 
ends internally while they store their own disk images with 0x0A endings in 
Apple plist XML files.  That makes it impossible to edit a worksheet using 
bbedit itself; there are mixed line ends in the file.  MPW operating on that 
SE/30 or this 8500 works much better.

I'm pretty sure that the official rule is that on a Macintosh \r is still 
supposed to be interpreted as 0x0A and \n is 0x0D. That is the way it was in 
some RFCs when MPW was the way Macs worked. They haven't been updated and it 
pays to be careful on OS X.

-- 

-- A fair tax is one that you pay but I don't --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Large copy-paste from Excel

2012-08-03 Thread Doug McNutt
At 04:31 -0700 8/3/12, mkowsl wrote:
Copy-paste of large (1 cases) columns from Excel to BBEdit (10.1.2) 
fails, but works to e.g. Textedit...any other observations in that respect?

Watch the line ends. They're likely to be 0D from Excel and BBEdit might get 
upset if the destination file is already 0A.
-- 

-- A fair tax is one that you pay but I don't --

-- 
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit





Re: Troubleshooting bbedit/p4 integration

2012-06-21 Thread Doug McNutt
At 17:19 -0700 6/20/12, mason k wrote:
Thanks. I went and refreshed my memory on how Mac handles environment, and 
ended up at this http://stackoverflow.com/a/4567308/86432stackoverflow 
answer answer, and went with ~/.launchd.conf

On Tuesday, June 19, 2012 12:32:35 PM UTC-4, Rich Siegel wrote:

On Tuesday, June 19, 2012, mason k 
mailto:mason.kra...@gmail.commason.kra...@gmail.com wrote:

bbedit doesn't seem to be sourcing ~/.profile or ~/.bashrc before it runs.

GUI applications don't get your bash (or other shell)
customizations; you need to use ~/.MacOSX/environment.plist. See 
http://developer.apple.com/library/mac/#qa/qa1067/_index.htmlhttp://developer.apple.com/library/mac/#qa/qa1067/_index.html.

R.

BBEdit and other applications can be run from a Terminal session.

If you start up BBEdit using the bbedit tool to open a file with a command you 
will become a process as a child of Terminal.app which will have your 
environment and other settings in .tcshrc for me or .profile for folks who 
didn't learn the Apple command line in MPW.

I start up a BBEdit worksheet that way and use stored startup lines inside 
which open other text files when I want them.

-- 

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Text Factory for Delete Characters until X

2012-03-30 Thread Doug McNutt
At 13:00 -0700 3/29/12, Todd wrote:
Long story short: I'm needing to open some word processing files that
can't be opened in Mac OSX Lion (Lion vs. Rosetta thing...) and need a
bit of helping creating a Text Factory.

When I open the files in BBEdit, I get a string of characters,
anywhere from 50-100 characters (such as
40 0ÇÇ 480048 -2 2 91A 20 0Å 20 -1Ç 91F 921 909 90B 0¬  2 13 91A 1DB FFF)
that are immediately followed by a COMMA, then begins the text.

Is there a way to create a Text Factory that will look for the first
instance of this COMMA, then delete it and everything PRECEDING it?

Also, there's a block of text at the end of every doc containing
similar strings. I guess what I need there is something like find the
LAST instance of a period, then delete every character after that.

Or is something like this better suited to an AppleScript? Any ideas
where I can start here?


$data = result of reading the contents of the file into a string.
$data =~ s/\A.*,//;
$data =~ s/\.[^.]*\Z//;

BBEdit converts what it reads to 16 bit - almost all of UTF - characters which 
might well get confused with what is apparently binary stuff at the start of 
the files. That might make a Text Factory fail unless there is a way to apply 
the factory before reading the file into memory. I'm limited to OS X 10.3.9 and 
there have been changes.

Assuming your file is 8 bit stuff like UTF-8 or ASCII the above is what I would 
use before trying to open it with BBEdit. Perl or sed will handle the regular 
expressions. \A is the beginning of a file and \Z is the end with an optional 
line end.

Putting the binary stuff back is likely impossible especially if it depends on 
the text you will be working with.


-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: \1 in AppleScript

2012-02-10 Thread Doug McNutt
At 10:35 -0800 2/10/12, James wrote, and I snipped:
The BBEdit manual calls attention to the fact that AppleScript
compiler and BBEdit both use a backslash to escape and read the
immediate glyph as a literal. Thus, to automate a grep search the
BBEdit manual recommends the following piece of code:


Have a look at AppleScript's quoted form of directive.

If you need special escape characters like \ you find that you need to escape 
the escape character to get past conflicting interpreters.  You wind up with 
three backslashes in sequence. Quoted form of seems to handle it well.

-- 

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Find-Replace using LaTeX commands

2012-01-17 Thread Doug McNutt
At 12:07 -0800 1/17/12, Govinda wrote:
If I understand what you are asking correctly, then yes:
\r = the line ending character
\t = the tab character

if you want to find the *literal* string \r, then you would search
for it this way:
\\r

The \ char escapes whatever comes next.


It helps to understand that when bbedit has a file open for editing the entire 
document is stored as 16 bit UTF characters.  The \ character used as an escape 
elsewhere is essentially never there at all. (Editing a shell script might be 
an exception to that.) Also all input line ends are represented as 0X 000D, the 
standard for Apple of old.

If your external text uses 0x0A or a 0D0A pair they're 0x000D in memory.  Only 
one kind of line end is allowed in a file coming in.  BBEdit takes a guess at 
which one is the real one if your source has a plurality of them as you might 
find in a teletype message of old.

-- 

-- The U. S. Census Bureau missed a bet by not counting all of those embryos 
in cold storage. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Files won't open

2011-10-23 Thread Doug McNutt
At 19:02 -0700 10/22/11, Watts Martin wrote:
On Oct 21, 2011, at 16:43 , Doug McNutt wrote:

bbedit will not process files that have mixed line ends.
It won't even allow you to repair such files.
As an example try opening a bbedit worksheet as a plain text file.


I put a few commands in a new blank worksheet, saved it as testme.worksheet, 
then forced it to open as a new plain text file by opening it on the command 
line with:

   cat testme.worksheet | bbedit

...and it opened as a text file just fine. What is it you were trying?


Well.  I might have been a bit brusque.  Today, using bbedit  8.5.2 which is as 
far as I can go with X 10.3.9 which is as far as I can go and still use my 
SE/30 file server. . .

I can in fact open files, such as a bbedit worksheet, in text mode.  I swear 
there was a time when bbedit would simply refuse to open such files.  Linux 
gedit continues to do just that and I do remember comparing it to bbedit at the 
time. It was when Bare Bones started using 16 bit words during its editing 
process that I first had problems. That might have been version 8.0. Version 
8.5 still works fine on this 8500 but there an escaped n means 0D and the 
escape character is OPTION d. Yes. I still use MPW.

Version 8.5.2 bbedit worksheets are really XML files of the Apple plist 
variety. The line ends for the XML part are 0A or \n . The worksheet part is a 
dict. entry inside of the XML which uses 0D or \r to separate lines as they 
would be interpreted in a Terminal worksheet.

If you open a worksheet as text, piping as above is one way, the file appears 
to be plain text and, except for visibility of the XML parts, is just like the 
worksheet. But you'll have trouble editing it and saving the results as a 
working worksheet. I really wanted to do things like that so I could muck with 
the saved startup directory and perhaps more like automatically running a shell 
script as each worksheet is opened.

When you save a worksheet opened that way all line ends will be converted to 
the end character specified in the tool bar at the bottom of the edit window. 
That means the modified file cannot have different ends for the XML and dict. 
parts as apparently required by the format. After modification and storage it 
will not work as a worksheet regardless of the creator and type settings. I 
always keep file specific settings in its resource fork.  Bbedit also can save 
such things in a time-expiring list in someone's home directory. The difference 
might be important in the piping technique used above.

Actually, worksheets remain a small part of the real problem.  I work with 
machine tools and other text-like command or assembler files that need viewing 
of variable width tab separated columns, and a couple of different line end 
characters that are used for different purposes.  Bare Bones does not feel it 
appropriate to support those things and neither does anyone else.  Spreadsheets 
are what I use when I can but more often it's home grown perl scripts without 
the benefits of a GUI editor. Full fledged word processors offer entirely too 
much and often make it nearly impossible to save without any markups at all. 
Nisus in its earlier versions was nice for that but as of OS neXt it's just 
like all of the others.

ftp://ftp.macnauchtan.com/Software/LineEnds/  might be interesting to some. 
It's  Applescripted C that I worked out to work with line ends. Source code 
included. There was another gentleman on this list whose problems were similar 
to mine a few years ago. He offered some C code that worked with 0A and 0D. I 
dressed it up to include 0D0A pairs and provided a drag and drop AppleScript 
interface which changes line ends and allows for an Examine that generates a 
count of all 3 line ends.

ftp://ftp.macnauchtan.com/Software/BBEdit/  Also has some stuff that allows 
worksheets to execute some csh code as they are opened. It does not try to edit 
the internals of a worksheet.


-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Invisible Character Mystery

2011-10-21 Thread Doug McNutt
At 07:22 -0400 10/21/11, François Schiettecatte wrote:
Maybe it got copy-pasted in, or you duplicated the file from another one, at 
this point this is speculation.


It's possible that the behavior depends on the format in which the file is 
actually saved on disk.  Most of use UTf-8 which would look like bytes of old.

But what if the OP has storage set to one of the UTF-16 options?  Would things 
be different?
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Use worksheet with LaTeX

2011-10-07 Thread Doug McNutt
At 21:52 +0200 10/7/11, Marek Stepanek wrote:
Thank you for the quick answers. Herbert, Maarten you where right. It was 
pretty clear, that my worksheet was starting in my ~/ home folder. I changed 
the directory with cd to the folder, where my file.tex and file.worksheet are 
saved. And now it is compiling as it is intended. But you are right: the 
output is written to the worksheet and I have to make a CMD + Z and CMD + S to 
get rid of it. Is it like that it is intended to work?

Strange: the worksheet is staying now in the starting folder, also after a 
restart of BBEdit. Will it stay here also after a new start of the computer?

No I will stay with vim and my second terminal window to run my commands.

But I will look into the suggested ShellScripts which Maarten suggested.

BBedit 8.5.2 on MacOS 10.3.9 is as far as I go.

But have a look at: ftp://ftp.macnauchtan.com/Software/BBEdit/.  There are 
some files there that start with Worksheet which I use to execute a few lines 
of text from a worksheet each time it is opened.  Typically I define $PATH and 
set the current working directory but I might also tell Finder to open a 
directory or two. I often ask Vectorworks to open a particular design file.

It's somewhat a labor of love and I use it with tcsh which is much closer to 
MPW than bash and is OK to use if you stay away from fancy scripting. I did 
some tests with bash but they were not complete.  It will take a bit of loving 
application of geeky things including modifying your $HOME/tcshrc or profile 
startup scripts so they recognize the initial call that is made when bbedit 
opens a worksheet.

For me it answered a lot of your frustration. Coming from MPW where such things 
were simple I thought I really needed them on a worksheet that would run under 
OS neXt.. BBEdit remains the only real potion.

In that ftp directory there is also a copy of Services.dmg.  It allows you to 
select lines in a bbedit text file and execute them in a shell.  Things like

date | pbcopy
bbedit SomePath

Run nicely, populating your clipboard with the UNIX date and time or opening a 
common file you need.

As for unwanted writing to a worksheet you can redirect stdout and possibly 
stderr to an open bbedit text file if you want.  Bbedit will happily reload the 
modified file the next time you bring its window to the front.
-- 

--  Halloween  == Oct 31 == Dec 25 == Christmas  --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: sh script

2011-10-02 Thread Doug McNutt
At 15:13 +0100 10/2/11, Phil Dobbin wrote:
I got it working on the command line by cd'ing to the directory it was located 
in  giving it an absolute path using ~/

AppleScript is well known for not running startup scripts for shells.  Your 
$PATH variable may not be what you think..

That tilde I see at the end of your line above scares me.

Is your script perhaps in $HOME/bin/ ?  AppleScript won't find it without a 
full path and it might not understand the tilde either. You can't set a working 
directory in AppleScript unless you do it for each do shell script call.  
BBEdit worksheets are a bit better but you still can't set a directory in one 
worksheet and discover it in another.
-- 

--  Halloween  == Oct 31 == Dec 25 == Christmas  --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: sh script

2011-10-01 Thread Doug McNutt
At 23:18 +0100 10/1/11, Phil Dobbin wrote:
On 1/10/11 at 21:30, chip.war...@gmail.com (Chip Warden) wrote:

It looks like you have a space in your shebang line where it shouldn't be. 
The line should look like:
#!/bin/bash

not:

#! /bin/bash

Hi, Chip.

I did notice the erroneous space  deleted it but it still throws the same 
error.


Your file may need to have it's execute permissions bit set.

Bash is a default for shell scripts. You might not need it and without it the 
text file, executable or not, would be passed to bash by default.

It's amusing to see what happens when bbedit or AppleScript creates an instance 
of bash which then creates yet another instance of bash because of the #! line. 
It makes one wonder just how smart the UNIX kernel is.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: possible to set upper case tags as the default?

2011-09-30 Thread Doug McNutt
At 06:46 -0700 9/30/11, blinde wrote:
brian

thank you. as usual, I am late to the game and dragged kicking and
screaming.  8-)

although I find uppercase tags easier to parse in long docs I have
heard and will obey


And those of us who grew up with all capitals using six bit bytes and Hollerith 
cards find it impossible to understand why the numerically smaller ASCII codes 
- capitals - are not the standard today for what amounts to acronyms used for 
tags. 

But then folks, who don't capitalize sentence starts and names, are not allowed 
to complain about the modern defaults.

And I do see a capital I or two up there.  Is that to avoid confusion with the 
likes of iCloud?

-- 
1801 - Joseph Marie Jacquard uses punch cards to instruct a loom to weave 
hello, world into a tapestry.

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Replace with newline character

2011-09-30 Thread Doug McNutt
At 09:49 -0700 9/30/11, Fletcher Sandbeck wrote:

Remember that bbedit works with everything as 16 bit unicode.  There, all line 
ends are Apple style 000D entries.

Regardless of what will come out on a save you have to check for 0D while it's 
in memory.

It was once true that, for Apple machines, 熟, with an OPTION d greek delta as 
the escape character, was 0D.

Sometime, about when the neXt folks took over, the delta became a \ for the 
escape as in UNIX and you need to use \r in memory for new versions of bbedit.

So


search for \r and replace with ;\r in memory.  bbedit will honor your choice of 
\n = 0A when saving the file.

What happens with the other two 16 bit line ends in unicode is undetermined.

-- 

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: How to make a feature request for moveable (variable) tab stops?

2011-09-19 Thread Doug McNutt
At 12:14 -0700 9/19/11, Watts Martin wrote, and I snipped:
People who want variable tab stops don't want to have a filter applied after 
the fact to line up text in columns using spaces or a mix of fixed-width 
spaces and tabs; they want tab stops, like a word processor. That is, you can 
set a tab stop at column 20 and column 30, and then type 
OnetabTwotabThree and have Two and Three display at column 20 and 30 
respectively -- but there remains just a single tab character between the 
words.

BBEdit's scripting/filtering is powerful, but I think supporting that actually 
requires a change to BBEdit's code.

And, in the world of X-code it likely requires overriding of Apple-provided 
text manipulation classes and methods.

-- 
-- Give me liberty or give me Obamacare --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: GREP/Regex for dummies?

2011-09-06 Thread Doug McNutt
At 14:58 -0400 9/6/11, Jefferis Peterson wrote:

^([A-Z0-9]+) (.*) [0-9]+ $

Just curious... A space in the Find field using Grep... Isn't seen is it?
Like the space before the $  ?

If no spaces are found before or after in your original Find above, does
that stop the search?   IOW, what is the symbol for optional but not
necessary spaces? 


The spaces are treated as part of the expression. You are demanding their 
presence to get a hit.

That's more obvious in perl where regular expressions are always quoted, 
usually using the / character as the quoting character.

/^([A-Z0-9]+) (.*) [0-9]+ $/

Is what you would use. There are three spaces in it and all are required to get 
a hit.

(.*) followed by a space is curious. The * will match the space and demanding a 
real space can cause problems with the greedy concept where matches go as far 
as possible. (.*?) would turn off the greediness.  The ? mark can also be used 
to specify an optional character as in ( ?) where those parentheses are not 
required unless you want a capture.

Note also that [A-Z] will match only upper case.  There are also \d and \w for 
matching more general letters and digits.

And I still use the Regular Expression Bestiary, a chapter in Programming 
Perl which is another O'Reilly book that's not for geometric readers.


-- 

   Fe++
//  \
Fe++  Fe++
  |   ||
Fe++  Fe++
   \\/
   Fe++

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: C++

2011-08-19 Thread Doug McNutt
At 08:35 -0500 8/19/11, David Kelly wrote:
 Create a wrapper script around the tool, and run it from there, just
 like any other tool. That assumes the second use case.


In the days of MPW and later in the very early days of BBEdit worksheets it was 
possible to include compile, link, and execute commands in the text file that 
was the C source code.

The # in #! was carefully selected to be treated as a comment in most source 
code syntax.

#!/usr/bin/tcsh   (Not needed in MPW which is csh all by itself)
#IFDEF nonsense   (Never defined anywhere!)
gcc myself -o $HOME/bin/somebinary  (or perhaps something in /tmp)
link . . .  (When in MPW)
somebinary
exit
#ENDIF
include ...
main;
print Hello World;
.
# all done



It was possible to execute such a text file just by giving its name or select 
and ENTER in a worksheet. Almost as simple as a deck of FORTRAN cards inserted 
in a card reader for load and go of old.

The technique is still possible for simple things but it sure would be better 
if BBEdit worksheets could once again be executable text files as opposed to 
XML plists.  I can no longer execute a worksheet from another worksheet and I 
miss it.

-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: How to make a feature request for moveable (variable) tab stops?

2011-08-19 Thread Doug McNutt
At 09:05 -0700 8/19/11, hermione_havanese wrote:
How to make a feature request for moveable (variable) tab stops?

I realize BBEdit is not a spreadsheet or word processor, but I find
that wider tab stops can sometimes help with reading complicated (to
me) code.

Is there any reason not to allow this feature?

I second the motion.  But I have asked for it before. The Bare Bones answer is 
We make text editors, not word processors.

I suspect that BBEdit is now well integrated with Apple-provided display of 
text items with mousing around included.  Evidence is that constant-width tab 
stops are set using the View:Text Display:show Fonts menu.  That sounds a whole 
lot like X-code standard software tools to me.

This week my problem was a table of printed circuit board connections. The 
columns were: device identifier that needed up to 8 characters, pin number with 
a max of two digits, text defining the signal involved up to 20 characters but 
usually less than 8, a comment field extending indefinitely.

BBEdit was useless. Using multiple tab characters between columns is not 
acceptable to target software.  The solution was Nisus 5.1 that runs fine on 
this OS 9 box but doesn't work for me on OS 10.  The comments nicely wrapped 
into the last column when necessary because they would extend beyond the right 
side of the page. I didn't waste a bunch of horizontal space for the pin number 
column.

And. . . .  Design of printed circuits is NOT a problem for a word processor.  
It needs a text editor that honors conventions characteristic of a typewriter 
or an 026 card punch.
-- 

   Fe++
//  \
Fe++   Fe++
  |   ||
Fe++   Fe++
   \\/
   Fe++

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: How to make a feature request for moveable (variable) tab stops?

2011-08-19 Thread Doug McNutt
At 14:04 -0700 8/19/11, Watts Martin wrote:
I'm not clear from Doug McNutt's earlier message whether what BBEdit was 
useless for was the insert a single hard tab between columns described 
above, which indeed most text editors would be lousy at but most word 
processors would not, or what he needs to do is to set space-filled columnar 
data in the way of an old punch card, i.e.:

[-field-][-field-][---field---]
text more text starting here  other text
foobar   walla walla bing bang23skidoo

...which BBEdit could do, just not as conveniently as Emacs


The problem is that I use other software and hardware - think numerically 
controlled lathe and circuit board creation.  They expect the tab characters 
with one  tab per column and they get very upset with markup language, table 
and the like. Gerber files, once you get there, are fine in BBEdit.

Nisus 5.1 was really great.  It kept all of the text in a data fork and all of 
the  formatting in the resource fork. The text files were usable everywhere. No 
more.  It's now a typical OS 10 word processor.

The other option is Microsoft Excel which, to say the least, is more than I 
need but it does work with tab separated data both in and out. perl does a fine 
job of fixing bad files. The main use for a text editor is debugging when the 
whole idea is to look at the files produced elsewhere. It would be nice to use 
the same editor I use to work with perl and 8 bit assembly code.

And the 026 card punch allowed you to put a punched card on a drum. When you 
poked the tab key the working card was advanced to the next hole in the drum 
card.  Just like a typewriter.

I'm currently looking at gedit which requires python that I'll have to learn 
but at least the source code is mine to play with. Right now it's just like 
BBEdit.

And oh yes, your field example required that I look at the message in a 
constant width font. BBEdit doesn't require that but with Eudora it's just a 
mouse click.

-- 
-- Give me liberty or give me Obamacare --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Insert date with GREP

2011-08-18 Thread Doug McNutt
At 07:08 -0500 8/18/11, Christopher Stone wrote:
On Aug 18, 2011, at 03:23, Mark wrote:
 Does anybody know if there's a way to enter today's date via search and 
 replace? I have files with strings like this
 imported2009-02-12/imported and I'm processing them with a text factory

Personally, I always have a BBEdit worksheet open.  It's likely that I executed 
a  bbedit tool command to open the file I'm working on anyway.

In that worksheet there is a line like this

date | pbcopy

All I have to do is select the line and push the ENTER key.  Today's date and 
time are placed on the clipboard and I can paste them anywhere I want in the 
document I'm editing.

You can also specify the format of the string returned by the date tool;  man 
date at the bottom of the worksheet  for all of that.


-- 
-- If the US citizens between 18 and 21 would exercise their right to vote we 
wouldn't have a 21 year  drinking age. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: FTP/SFTP Browser shows two folders in every directory

2011-08-14 Thread Doug McNutt
At 13:52 -0700 8/14/11, Govinda wrote:
I really want to ask more questions here .. but perhaps BBedit users
will (rightly) feel I am going too OT.  (Like WHY does it not work to
just be in the right directory and type the name of a command?; why
does the command have to have the './' first?  I guess I need to find
a good CL forum and ask about what you meant Herb, when you referred
to PATH?

Bare Bones really needs a special mailing list for BBedit worksheets.  Your 
questions would be fully appropriate there and I certainly recommend that you 
get into worksheets for your future travels into Terminal land.

When you start up a terminal session the shell hashes the commands it knows 
about. It looks at the current value of your $PATH environment variable, which 
is a colon separated list of directories in which it expects to find tools, and 
takes note of all of the executable files it finds.  It's that hash that is 
used when you type a command name.  The command, echo $PATH, tells all.

It's a relic of the days when building the hash was a slow thing to do and 
there was an advantage in doing it only once.  In the c-shell - Apple's 
favorite in their MPW shell of the classic OS - there is a rehash command that 
will ask the shell to repeat the task.

By providing a full path for an executable, as you do when you prepend ./ to a 
filename in the current directory you tell the shell exactly what to execute 
and the hash is ignored.

You can change the $PATH variable which is just another environment variable.  
In my $HOME/.tcshrc I add to the default path with this:

setenv PATH $HOME/bin:$PATH

which adds a directory bin that I keep in my home directory in front of the 
default.  It's also possible to add . to your path which would include any 
current directory but that's considered a bad thing to do for reasons involving 
security.

And yes.  The c-shell is deprecated these days but I use MPW on my older Macs 
and I like to keep things more or less the same on OS neXt.  You can do 
everything in bash just as well. Some say better.

If you're an AppleScripter - BBEdit is pretty good at that - you just might 
want to muck with the PATH that do shell script uses.  In 
$HOME/.MacOSX/environment.plist you can reset your PATH variable so that it  is 
honored globally, even when you start up a BBEdit worksheet..

-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: What's the BBEdit Sales Pitch?

2011-07-28 Thread Doug McNutt
At 20:49 -0700 7/27/11, Brett Kelly wrote, and I snipped:
If somebody asked you, my new friend, why you use BBEdit, what would you tell 
them?

BBedit worksheets are the only reason I switched.

Apple's MPW, Macintosh Programmer's Workshop, was never ported to OS 10 and 
BBedit was the only option that attempted to recover the MPW shell, a text 
editor that allows execution of commands by selecting and entering - with a 
mouse - lines of text within the document. The meanings of the ENTER and RETURN 
keys are different.

I still prefer to use MPW on this OS 9 box but BBedit remains the only command 
line in the text file option for OS 10. It's not perfect and I have a bunch of 
complaints but it's better than nothing.

-- 
--  There are 10 kinds of people:  those who understand binary, and those who 
don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-27 Thread Doug McNutt
At 10:40 -0700 7/27/11, Watts Martin wrote:
Bruce Van Allen wrote, and I snipped:

I suppose to be precise I should have said there appeared to be no UI control 
to adjust the tab width on a document-level basis.


Just in case anyone at Bare Bones cares:

While you're making tab width adjustable on a per file basis it would really be 
great if you could arrange for tab stops as in a real typewriter.  I am 
continually frustrated with columnar data that demands a wide column on the 
left side - full names for example - followed by a couple of small width 
columns like date and $. Multiple tab characters cannot be used because the 
final destination of the file won't accept them.

The alternative is a full fledged spreadsheet but I really don't need that just 
to look at, yeah and modify, the data.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Per document tab widths

2011-07-27 Thread Doug McNutt
At 13:13 -0500 7/27/11, David Kelly wrote:
On Wed, Jul 27, 2011 at 12:04:32PM -0600, Doug McNutt wrote:
 
 Just in case anyone at Bare Bones cares:
 
 While you're making tab width adjustable on a per file basis it would
 really be great if you could arrange for tab stops as in a real
 typewriter.  I am continually frustrated with columnar data that
 demands a wide column on the left side - full names for example -
 followed by a couple of small width columns like date and $. Multiple
 tab characters cannot be used because the final destination of the
 file won't accept them.
 
 The alternative is a full fledged spreadsheet but I really don't need
 that just to look at, yeah and modify, the data.

Sounds as if you are asking to further blur the difference between a
text editor and a word processor.

Am not sure if Nisus still behaves the way it originally did, but it was
a word processor that left the data fork as pure text while putting all
formatting metadata in the resource fork. Originators of QUED/M, which
for me was replaced by BBEdit.

I still use Nisus  5 or so on this OS 9 box.  As of OS 10 Nisus became just 
another markup based word processor. Really good for right to left Arabic with 
included left to right Arabic numbers..

I even have a preset resource file into which I can redirect a data fork that 
is an assembly language listing for a 68HC11 microprocessor. Variable width 
tabs are really nice for that. I can even word wrap comments into new lines 
that begin at the rightmost tab.

I'd really rather use BBEdit on Apple's OS 10. (Which sort of keeps this on 
topic.)
-- 

   Fe++
//  \
Fe++  Fe++
  |   ||
Fe++  Fe++
   \\/
   Fe++

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: BBEdit not setting execute bit

2011-07-21 Thread Doug McNutt
At 23:26 -0700 7/20/11, TJ Luoma wrote:
The manual (pdf page 304) says

 Additionally, to execute scripts anywhere outside of BBEdit (e.g. in the 
 Terminal), the system requires that the script file have 'execute' 
 permissions set. Thus, when you first save any script file which contains a 
 shebang (#!) line, BBEdit will automatically set execute permissions for 
 your login account (a+x, as modified by the umask) on that file.


The problem is that doesn't seem to happen for me. #! scripts get
saved as the same as text files. (I'm not on a file vault.)

I created a file like this:

#!/bin/bash

echo 'hello world'

exit 0

and saved it as testtj.sh but then when I check the permissions:

% ls -l testtj.sh
-rw-r--r-- 1 luomat 41 Jul 21 02:23 testtj.sh

(My umask is '022')

bb10 on Lion on a MacBook Air


That may well be an Apple Inc. problem.  Try setting an execute bit using 
Finder. Last I looked it was quite impossible. I'm forever chmod +x ing my perl 
scripts.

But what's worse:  Try making a BBEdit worksheet executable the way I do it 
with MPW.

-- 
1801 - Joseph Marie Jacquard uses punch cards to instruct a loom to weave 
hello, world into a tapestry.

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: BBEdit not setting execute bit

2011-07-21 Thread Doug McNutt
At 08:44 -0500 7/21/11, Fritz Anderson wrote:
On 21 Jul 2011, at 7:10 AM, Doug McNutt wrote:

 But what's worse:  Try making a BBEdit worksheet executable the way I do it 
 with MPW.

Eh? Worksheet documents are XML, and must be expected to interleave commands 
with their results. Why would you want/expect to execute them?

I do it regularly here on OS 9.  Interleaving occurs on the worksheet that 
called the other worksheet  to be executed in full.  Of course OS 9 doesn't 
have an executable bit. All text files are executable in MPW.  One thing I like 
to do is to make the first few lines in scraps of C code separated off by 

#IFDEF nonsense
commands
EXIT
#ENDIF

Those commands can be the call to a compiler and linker so executing the C 
source code amounts to a compilation with all the libraries I need.

And yes I can use BBEdit 6.5 to create those scripts too.

And there was a time when BBEdit worksheets were plain text. The XML bit using 
both 0A and 0D line ends is a PITA that I think I shall never discover a reason 
for. You can't even open them as plain files in BBEdit.

-- 
-- Use vowels every day or you'll get consonated --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: BBEdit 10 cost

2011-07-19 Thread Doug McNutt
At 17:02 -0700 7/19/11, Warren Michelsen wrote:
One day, when I abandon Eudora and upgrade to 10.6+, I'll upgrade BBEdit too.

I love it!

This machine, an 8500, runs Eudora 5.1 and BBedit 6.5. A big advantage is that 
it doesn't keep changing on me.

I'm also limited to another old version of BBEdit on my OS 10.3.9 G4.

What's worse is that I don't even have BBEdit on my Linux/ubuntu box. I can 
only run gedit which doesn't handle shell access the same way MPW and BBEdit do 
on my Macs. But I can amuse myself with altering the source code of gedit to do 
what I want.

I'd be happy to pay for BBEdit worksheets on ubuntu just as I would for MPW 
that way on OS neXt. I don't expect it but that price for a newer or better 
version would be fine by me if it worked on Linux.

-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Why does this group expose our private email addresses?

2011-06-26 Thread Doug McNutt
In days of old, before high speed internet, the approved procedure for replying 
to a posted bessage was to address the reply to the sender with a copy to the 
list.

The reason was that you could get the question answered right away without a 
long wait while an answer found its way through a couple of long paths to the 
list and back to the poster.

It's a bit of a PITA when people do that now but many do, likely because that's 
the way their mail clients default.

Without a proper from address in the message that wouldn't work.  It's likely 
that the list is complying with some RFC standard though I don't know the 
number.

Best to have an address for lists only and to filter it so that the only thing 
you get has to come with a List-ID header that matches one of your subscribed 
lists.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: AppleScript Open File in BBEdit 9.6

2011-06-22 Thread Doug McNutt
At 12:04 -0700 6/22/11, Rich F wrote:
For the life of me I can't find a way of opening a file in a
subdirectory in my webserver directory.


set myF to file /Library/WebServer/Documents/alpha/bravo/items.lasso

tell application BBEdit 9.6
   open myF as alias
end tell


I'm biased but the sooner one gets out of Applescript the better UNIX works.

Install the bbedit tool from Bare bones

do shell script  bbeditquoted form of  
/Library/WebServer/Documents/alpha/bravo/items.lasso

-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: How to open in Browser window?

2011-06-14 Thread Doug McNutt
At 15:37 -0700 6/14/11, Lorel wrote:
I would like to know if it's possible to open an html document in a
browser window from inside BBedit


Isn't that what preview is all about?

But I always have a bbedit worksheet open and there it's trivial:

open -a Safari path_to_file

And it's OK to have that path point to a file you're currently editing in a 
BBedit window.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Search Replace

2011-05-29 Thread Doug McNutt
At 07:23 -0700 5/29/11, jj200...@gmail.com wrote:
Hi all I would like to find lines like below and replace them with
blank lines, I have read the GREP tutorial but had no succes PLEASE
help

p class=text08-06-2011 15:49:25/p
p class=text08-06-2011 15:54:45/p
p class=text08-06-2011 15:56:13/p

Also is it possible to script so I can replace different lines in the
same workflow??


It sorta depends on what else is in your file.  With grep turned on the idea is 
that .*, without quotes will match anything.  .+ will match one or more of 
anything.

p class=text08-06-2011 .+/p

would be a search string that would look for an identical date but would allow 
anything for the time part.

p class=text08-06-2011 [\d:]+/p

Would match times that have digits, \d, and colons in them.

How fancy you need to be is determined by the lines you want to keep. Doing a 
search and find next a few times before you replace all is a good way to check 
for accidental finds of something you want..

To replace just the text leaving a blank line your replacement string would be 
 - an empty string. If you want the whole line to go you could add \r to the 
end of the search string so you would be replacing the line end with nothing.

Note that you usually have to escape things in your search string that are 
special symbols used by grep.  That would include a period . but you don't 
seem to have anything like that in the line as you present it.

As for different lines, that would be a script or a text factory. Personally I 
find plain old perl scripts are easier but that's just me.
-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Saving 2 copies, one with a tilde after the title

2011-05-03 Thread Doug McNutt
At 13:11 -0700 5/3/11, Bo wrote:
It doesnt always happen, but for a while now, when I save a file, it
creates another copy, with a tilde after the name. Is there some
setting that will alter this behavior?  Is this a bug?


Hmmm..   My Linux editor of choice is gedit and it does that too. It's a common 
UNIX procedure from long ago.  What has happened is that BBEdit has renamed the 
previous version with the trailing tilde. The replacement is given the name you 
expect.

It can save your ass.

It's pretty easy to execute a rm *~ in a BBEdit worksheet to toss out the old 
copies but in general that ought to be done only after a night's sleep or when 
you disk starts complaining about being full.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Change file permissions and ownership.

2011-04-16 Thread Doug McNutt
At 10:15 -0700 4/16/11, JRC wrote:
Can I use BBEdit to a file's permission and/or ownership after I am
done editing it ?

I have used BBEdit to make a small revision to a file and then saved
it. Now I am trying to change its permissions and ownership. I am
curious to learn if I can use BBEdit for this task instead of
Terminal.


You can surely do it with a BBEdit worksheet. The command would be:

SetFile -t  TYPE -c creator  PathToFile

Type and creator must be exactly 4 8-bit characters and quoting may be required 
to get that from your shell.  You'll also need the tool which comes with 
Apple's Developer Tools. It's OK to have just the SetFile tool if it's in your 
$PATH somewhere.  There is also GetFileInfo for the reverse.

And the tool names are case sensitive even on case insensitive disks. It's 
because of the way the shell works.


-- 
A billion seconds ago Jimmy Carter was president.
A billion minutes ago was just after the time of Christ.
A billion hours ago man had not yet walked on earth.
A billion dollars ago was late yesterday afternoon at the U.S. Treasury.

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: GREP to clipboard?

2011-03-23 Thread Doug McNutt
At 12:55 -0700 3/23/11, Bo wrote:
Is there a way to do a grep search and replace all then copy to
clipboard so I can paste elsewhere?

try piping the output from grep to pbcopy

grep  lookfor  fileglob | pbcopy

man pbcopy
man pbpaste

-- 

-- In Christianity, man can have only one wife. This is known as monotony. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Deliberately hijacked thread, Webmaster

2011-03-17 Thread Doug McNutt
At 07:46 -0500 3/17/11, Fritz Anderson wrote:
I wish you would not start a new thread by replying to another. Other peoples' 
mail clients display your message as part of the other thread.


The offending posting came from Webmaster webmas...@endtimeprophecy.net and 
contained these headers:

Message-Id: p06240800c9a7731b2b79@[192.168.1.103]
In-Reply-To: r420ps-1066i-61806CD03970405B874EEA2932E5E543@Volante.local
References: r420ps-1066i-61806CD03970405B874EEA2932E5E543@Volante.local
Date: Thu, 17 Mar 2011 18:17:24 +1000
To: bbedit@googlegroups.com
From: Webmaster webmas...@endtimeprophecy.net
Subject: How To Rewrap Lines To Specified Length In Folder Of Files

A search in the list for previous messages produced these:

Rich Siegel09:14 3/16/11   Re: How To Append Text String To EOF Using 
Global FR
Webmaster  09:45 3/16/11   Re: How To Append Text String To EOF Using 
Global FR
Webmaster  02:17 3/17/11   How To Rewrap Lines To Specified Length In 
Folder Of Fi
Fritz Anderson 06:46 3/17/11   Re: How To Rewrap Lines To Specified Length In 
Folder O
Webmaster  07:31 3/17/11   Re: How To Rewrap Lines To Specified Length In 
Folder O

Note that mail clients which use those In-Reply-To and Reference headers 
confuse, in this case, three separate topics because they are linked to each 
other. Linking is accomplished for users whenever they use the reply to option 
in their mail clients.

Changing the subject line on a reply is NOT equivalent to creating a new 
message!

That is rarely understood by email users. It's a shame that mail clients don't 
make it apparent to users. I guess it's because software salesmen don't want to 
confuse their users.

-- 
--A flashlight: is a metal tube used to store dead dry cells. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Command line make results

2011-03-16 Thread Doug McNutt
Has anyone offered a script or setting that will open a perl script and go to 
the line specified in an error message when the script is executed from within 
a worksheet?

-- 
--  The best programming tool is a soldering iron --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Problem with unicode and Tidy

2011-03-07 Thread Doug McNutt
At 11:18 +1100 3/8/11, Alex Satrapa wrote:
If someone can give me an example of where curly quotes are bad I'll stop 
using them - perhaps there is a popular screen reader used by blind people 
that chokes on Unicode punctuation.


There is nothing like an overzealous email client that defaults to changing 
ASCII quotes to curly versions when the information being transmitted is a 
bunch of shell script or C source.

And more on topic it appears that Tidy is trying to be helpful. My experience 
with such things is pretty much always bad. Microsoft Excel is terrible that 
way. 

We are on the verge of HTML-5. Does any one know if such things as xxx; are 
going to get deprecated in favor of unicode?

-- 
--  The best programming tool is a soldering iron --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Mac OS X Command-Line List? What about Perl?

2011-02-08 Thread Doug McNutt
At 23:49 -0700 2/7/11, LuKreme wrote:
I think bash is the most commonly used shell. I used zsh one upon a time, but 
then encountered a server cluster that didn't have zsh and had to unlearn some 
stuff, so I've stuck with csh (90s to early 2000s) or bash ever since, and 
mostly bash.


BBEdit worksheets are an attempt to mimic Apple's MPW of old. If you use a 
worksheet with tcsh specified you get a much closer approximation than with 
bash. The MPW commands were really based on csh but spelled differently.

But then, dammit, I can no longer just execute a BBedit text document the way I 
do with real MPW on this OS 9 box.

And, if you want to view a man file do it in a BBEdit worksheet.  No paging 
problems there.

-- 
--  The best programming tool is a soldering iron --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Applescript: Execute a line in a worksheet

2011-02-08 Thread Doug McNutt
At 12:18 -0600 2/8/11, Christopher Stone wrote:
Is there a way to execute a line in a worksheet via Applescript?

I've got a script that preassembles a command and opens it in a new worksheet, 
and I'd like for the script to execute the line as well to save me a step.


There certainly is a way to ask Terminal.app to run a command and there is do 
shell script which has a few problems with quoting. But. . .

ftp://ftp.macnauchtan.com/Software/BBEdit/WorksheetOpen

and a couple of other files in the directory 
ftp://ftp.macnauchtan.com/Software/BBEdit/.

I'm stuck on OS 10.3.9 because of my SE/30 file server so there have been no 
updates since Bare Bones stopped supporting 10.3. Those scripts might not work 
with newer versions of BBEdit.

What I do is take advantage of the fact that, on opening, a BBEdit worksheet 
has to make calls to a new instance of the declared shell. At least it has to 
set a working directory. It's possible to trap that call and cause a few 
commands in the worksheet to be executed. I identify them between lines like 
this:

##BEGIN
setenv WORK $HOME/projects/target
cd $WORK
source $HOME/bin/sshstuff
##END

When I open a BBEdit worksheet that I use to work on a project I get execution 
of that block of lines. I can also set up ID files for scp and ssh which are 
different for each project.

Watch out for worksheets though.  They are really *.plist files that use UNIX 
line ends for the XML stuff but change to Mac line ends for the part of the XML 
file that is really the text of the file hidden in an XML entity. You can't 
open one of those as a regular file with BBEdit.

I usually find it easier to use the osascript tool to call AppleScript commands 
from a shell script:

osascript  ENDSCRIPT
tell application BBEdit
   do something
end tell
ENDSCRIPT


-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Applescript: Execute a line in a worksheet

2011-02-08 Thread Doug McNutt
At 19:03 -0600 2/8/11, Fritz Anderson wrote:
On 8 Feb 2011, at 6:58 PM, Steve Piercy wrote:

 On Feb 8, 4:35 pm, Fritz Anderson fri...@manoverboard.org wrote:
 You're in for a treat. Select File  New  Shell Worksheet, and read what's 
 in the window that appears.
 
 (MacOS Error code: -4960)
 
 Where's my treat?

Your treat is that you have a story to tell supp...@barebones.com!

I have no Select File menu item.

FileNewShell Worksheet

works fine but then I'm limited to 8.5.2

There must be a template somewhere.  Has it been discarded?  Try this:

bbedit /Applications/BBEdit.app/Contents/Resources/Default Support 
Folder/Stationery/Default Worksheet Stationery

-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: AppleScript: Open Hidden Files like httpd.conf

2011-01-27 Thread Doug McNutt
At 12:16 -0500 1/27/11, Steve Kalkwarf wrote:
On Jan 27, 2011, at 11:45 AM, Herbert Schulz wrote:

 You can also use a feature that is part of any standard Open... and Save... 
 dialog: type Cmd-O to get the dialog. Then type shift-Cmd-G and a sheet will 
 slide down for you to put in the path to the file. This won't work for . 
 files since they will still be invisible but it will for files in hidden 
 folders.

Command-Shift-. will toggle the visibility of hidden files  folders.

Not always.  Apple does have some files that have been declared too important 
for that.  It was originally done with a hidden directory, named Hidden, near 
the root but it has been changed.

Making an alias to a hidden file can help with repeated needs to edit such 
things.

And don't forget the bbedit tool

open -a BBEdit   somefile  can be replaced by just bbedit somefile with a 
few more options.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Column size in tables

2011-01-23 Thread Doug McNutt
At 22:53 -0800 1/22/11, Ken Lanxner wrote:
Now that you have your answer, next time you might find such a question more 
appropriate on Bare Bones' Web Authoring List which is just the place to ask 
about HTML coding. A low traffic list but some very generous help there.

As a matter of interest I really thought, at first, that the OP was complaining 
about tables as handled from within BBEdit. That's a feature near and dear to 
me because I am always working with tab separated data that simply demands tabs 
that can be set like a real typewriter or an 026 keypunch.

I once used Nisus for assembly listings but that went away when they started 
using markups in the text part of the file.

I'm stuck on OS 10.3.9 and I sort of hoped newer versions of BBEdit might be 
doing what I need. It might even persuade me to give up my SE/30 file server. 
But no. It was about HTML.

Sigh.

-- 
-- If  it's not  on  fire  it's  a  software  problem. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Two BBEdit versions (8.7.2 and 9.6.2) how to separate prefs ?

2011-01-19 Thread Doug McNutt
At 14:15 -0600 1/19/11, Christopher Stone wrote:
On Jan 19, 2011, at 08:26, Gabriel Roth wrote:
 The application rooSwitch (http://rooswitch.com/) may help with this.
__

That's pretty spiffy.

Eudora used to allow multiple user-preferences, and when you launched any one 
of them it would use only the preferences specific to that folder.  I don't 
know if BBEdit can use prefs local to its folder.

This functionality would be fairly easy to emulate using Applescript.

On earlier versions of the Apple OS you could get that effect by changing the 
name of the program during, or before, the install process. Applications seemed 
to know their new name and use it while setting up preference files in the 
System folder.

I don't know if that's done by default in OS neXt but it certainly would be 
possible for Bare Bones to do things that way.

You could also set up another user and the preference files for the other 
BBEdit would have a different $HOME/library folder to work with.

-- 
-- Give me liberty or give me Obamacare --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Regex Find

2011-01-19 Thread Doug McNutt
At 14:26 -0600 1/19/11, Christopher Stone wrote:
 (Eventually I'll know enough Perl to be able avoid using multiple tools.)

Have a look at the * construct in perl which returns a list of all files in 
the current directory. The * is really a perl glob and you can put a regular 
expression there.

You might have a one-liner if you work at it a bit. A BBEdit filter, possibly, 
but I'm not clear on what directory you'll be in as you enter such a thing.
-- 

-- The U. S. Census Bureau missed a bet by not counting all of those embryos 
in cold storage. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Help to set up a filter!

2011-01-13 Thread Doug McNutt
At 17:07 +0100 1/13/11, Marek Stepanek wrote:

Thank you for your reply. Whether I did not understand your suggestion,
or you did not understand my problem :-)

The problem was iterating over many naked (with out any html-tags)
text in a large text file and tag these found occurrences, and replace
the line breaks with br. Meanwhile I found the solution, but I don't
know, why this is working with a while-loop, and not with a
foreach-loop. Since I am looking into Perl - this is now about 10 years
- I have had always this comprehension problem between while and foreach
constructs. Also if this is not on topic for this list, could somebody
explain me this difference?

When using the debugger with the following script and the following
example, it is working. Used as a filter in BBEdit, the last paragraph
is not tagged. Strange! That means, my filter is probably not right ...

#!/usr/bin/perl

use strict;
use warnings;

$/ = undef;
$_ = ;


while ($_ =~ m,(/p\s+[^]+?p),g) {
   my $paragraf = $1;
   my $orig  = $1;
   $paragraf =~ s,(/p)\n?,$1p class=links_normal,;
   $paragraf =~ s,\n\np$,/pp,;
   $paragraf =~ s,\n,br\n,g;
   $paragraf =~ s!\s{2,}!!g;
   $paragraf =~ s!!\n!g;
   s/$orig/$paragraf/;
}


Ahha.  Now I understand why you need the loop.

Two things worry me .  In the while loop you use the g flag. Perl has to 
remember where it is in the $_ string that is the document. When you do the 
substitution you are messing with the string that the initial match is working 
with.  Perhaps doing the substitution on a copy of what came in as $_ would 
make a difference because of that.

The other is that the matches need an s option to allow them to match the line 
ends. At least I think it does because match typically stops when it reaches a 
line end. But if it works in a shell I may have some wrong ideas.  With $/ 
undefined it's conceivable that the s option is not required.

That last substitution changes the value of $1 but I don't think that's germane.

It's also quite possible that what you get in a shell based version is working 
on a slightly different version. I'm pretty sure it is recreated from the 16 
bit characters that are in the memory image of the file and when it's delivered 
to the filter there can well be subtle differences - line ends for instance.

foreach typically requires a list as an argument.  while can use anything that 
returns a boolean logic item. there is also the   for (start; stop; 
increment)  introduction to a loop.

perl == magic

-- 
-- If  it's not  on  fire  it's  a  software  problem. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Scheme for shortcuts

2011-01-13 Thread Doug McNutt
At 20:43 + 1/13/11, Roddie Grant wrote:
Over time I've set up a lot of keyboard shortcuts, but they've been fairly
random, particularly with the modifiers used.

I'd like to be more organised so that, for example, Control+key does
something to the environment (toggle invisibles, softwrap etc) and
Control+Option+key inserts a clipping, and so on.

Before I work out my own scheme, I wondered if anyone has already done this?


I'll second that request.

On this machine, an old Mac running OS 9, I can use the enter key on the 
numeric keypad to execute, in a shell, the lines selected in an editor window. 
The enter key on the alpha keyboard just enters a return character.

How can I set that up in gedit to run a command the way it's done in a tools 
menu?

It's a real pain when I set up a command and reflexively poke ENTER only to 
find the selected line replaced by a line end. Thank you for a nice undo.

-- 
--  The best programming tool is a soldering iron --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Scheme for shortcuts

2011-01-13 Thread Doug McNutt
Belay that.  I thought I was talking to the gedit list.

My only complaint with BBEdit worksheets is that I have to copy and paste their 
contents into a text file before I can use them on Linux..  That crazy scheme 
with an XML file that has mixed line ends that even BBEdit can't read is a 
nightmare.


I'll second that request.

On this machine, an old Mac running OS 9, I can use the enter key on the 
numeric keypad to execute, in a shell, the lines selected in an editor window. 
The enter key on the alpha keyboard just enters a return character.

How can I set that up in gedit to run a command the way it's done in a tools 
menu?

It's a real pain when I set up a command and reflexively poke ENTER only to 
find the selected line replaced by a line end. Thank you for a nice undo.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Help to set up a filter!

2011-01-12 Thread Doug McNutt
At 19:12 +0100 1/12/11, Marek Stepanek wrote, and I snipped a bunch:
Hello all!

#!/usr/bin/perl
use strict;
use warnings;

$/ = undef;
$_ = ;

foreach ($_ =~ m,(/p\s+[^]+?p),g) {
   my $paragraf = $1;
   $paragraf =~ s,/p,$p class=links_normal,;
   $paragraf =~ s,\n\np$,/pp,g;
   $paragraf =~ s,\n,br,g;
   $paragraf =~ s!\s{2,}!!g;
   print $paragraf;
   $paragraf = ();
}

print;

*

The $ may be referring to the last match as it occurs in a previous loop 
operation instead of what you think.

But why do you need the loop at all?  The g flag will repeat each substitute 
over the whole text if the target is $_ instead of  $paragraf. In the loop you 
probably don't want the g's at all.

$/ = undef;
$paragraf = ;
$paragraf =~ s,/p,$p class=links_normal,g;
$paragraf =~ s,\n\np$,/pp,g;
$paragraf =~ s,\n,br,g;
$paragraf =~ s!\s{2,}!!g;
print $paragraf;

I may well be missing something like being sure not to replace accidental 
matches. Aren't those commas dangerous? You can use anything as the separator 
but I prefer the pipe symbol when trying to avoid /\/ teepees.  You may also 
need a ///s flag to allow matching of return characters. And come to think of 
it are they \n or might they be \r in BBEdit tradition?

-- 
--  The best programming tool is a soldering iron --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: How to force open files IN BBEdit?

2010-12-11 Thread Doug McNutt
At 19:08 + 12/11/10, John Delacour wrote:
On 11 December 2010 05:36, ricolich
richard.ronnb...@publishingkonsult.se wrote:

 I was probably not very clear in my question:...
 ... I just want to be able to open the file and view it's content in
 BBEdit, just as I can with any other type of text file, without BBEdit
 handing it over to any other app

Try this Apple/Perl script:

set _choice to choose file
set _f to POSIX path of _choice
set _tempdir to POSIX path of (path to temporary items from user domain)
set _tempfile to _tempdir  temp.txt
do shell script perl -e \
chdir qq~  _tempdir  ~;
open F, qq~  _f  ~;
open F2, qq~  _tempfile  ~;
while (F) {print F2}
close F2;\
tell application BBEdit to open (POSIX file _tempfile) as alias

--JD

Does the bbedit UNIX tool behave the same way as an open in the BBEdit 
application?

What about ending that with

do shell script /usr/bin/bbedit quoted form of POSIX file _tempfile

Perhaps the perl stuff would not be necessary. It's easy to make an AppleScript 
that could be named bbedit and even put into the dock.

-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: bbedit tool crontab

2010-11-09 Thread Doug McNutt
At 03:35 -0800 11/9/10, cp21yos wrote:
Following the instructions I was at one time able to use 'crontab -e'
to edit my cron file.


try
crontab -l | bbedit
-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Replace on Different Line Than Find?

2010-11-01 Thread Doug McNutt
!/usr/bin/perl
undef $/; # Tell perl to ignore line ends in the input.
$thetext = STDIN;  # read the whole document from standard input.
$e = \n;  # Make it clear which line ends your document has in it. You might 
want \r or \r\n.
# Do the substitutions (s///) using the s flag to include line ends and the g 
flag to repeat.
#begin single line that hopefully didn't get shortened by email.
$thetext =~ s/${e}movieYear : (\d\d\d\d)${e}(.*?)${e}title : ([\w 
]*?)${e}/${e}movieYear : $1${e}$2${e}title : $3 \($1\)${e}/sg;
#end single line
print $thetext;  # report the result to standard output.
__END__


Call perl like this.
perl -w filename.pl  filename.pl


Phantom.txt
some text
More text
movieYear : 1925
additional lines of text
title : The Phantom of the Opera
more lines


Kong.txt
some text
More text
movieYear : 1933
additional lines of text
title : King Kong
more lines


-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Replace on Different Line Than Find?

2010-11-01 Thread Doug McNutt
At 14:27 -0700 11/1/10, Warren Michelsen wrote:
At 1:05 PM -0600 11/1/10, Doug McNutt sent email regarding Re: Replace on 
Different Line Than Find?:
!/usr/bin/perl
undef $/; # Tell perl to ignore line ends in the input.
$thetext = STDIN;  # read the whole document from standard input.
$e = \n;  # Make it clear which line ends your document has in it. You 
might want \r or \r\n.
# Do the substitutions (s///) using the s flag to include line ends and the g 
flag to repeat.
#begin single line that hopefully didn't get shortened by email.
$thetext =~ s/${e}movieYear : (\d\d\d\d)${e}(.*?)${e}title : ([\w 
]*?)${e}/${e}movieYear : $1${e}$2${e}title : $3 \($1\)${e}/sg;
#end single line
print $thetext;  # report the result to standard output.
__END__

I'm sure this will work splendidly, if only I knew what you were saying...

So, if I save the above script as TitleYear.pl and have two text files to 
process, Phantom.txt and Kong.txt, how, exactly, would I invoke it?

path/to/TitleYear.pl -w Phantom.txt Kong.txt

***

 I confess that I don't know how BBEdit currently handles filters that run in 
perl.  I'm stuck on Mac OS neXt 10.3.9 because I refuse to give up my SE/30 
file server that needs Apple file sharing over ethernet. The result is that I'm 
way behind in BBEdit versions. (Confession:  I really like gedit under Ubuntu 
Linux. What I don't like I can change!)

If you use an ordinary Terminal session with the perl code named as you 
indicate you would first make sure your working directory is set with chdir and 
then enter:

perl -w  TitleYear.plPhantom.txt
# -   and later. . .
perl -w  TitleYear.plKong.txt

The  redirection operator tells the shell to use the file following it to be 
given to the perl filter as standard input. The results are being sent to 
standard output which will appear on the lines below your command in the shell. 
You could copy and paste them into BBEdit but I'm pretty sure there is a way to 
do that within BBEdit so that it replaces the content of an open file. Can 
someone help with that?

You could also do something like:
perl   TitleYear.plPhantom.txtFixedFiles.txt
perl   TitleYear.plKong.txt   FixedFiles.txt

which would redirect the first line's output to a new file FixedFiles.txt and 
add the second lines output to the file created by the first.

You shouldn't need the -w flag in the call to perl after you're satisfied that 
the code runs without error. It's just asking that warnings be displayed.

cat is the UNIX tool that concatenates files. Another option would be:

cat Phantom.txt  Kong.txt | perl  TitleYear.pl  Concatenated.txt

The | (pipe) operator says to pass the output of the cat program to the new 
perl tool as standard input.

You could also modify the perl code to pick up a list of files such as 
everything in the current directory that ends with .txt. That would involve 
looping over a list of arguments while running print statements to a single 
output file. That's a bit like your pathto line above.  Untested, because I'm 
preparing this on a Mac 8500 running OS 9, 

while (@argv)
{
$nextfile = shift @argv;  #get the next file in the list of arguments
open IN, $nextfile;
$thetext = IN;
#  do the above work as on a single file
print $thetext;
{

Your pathto line would be assuming that  TitleYear.pl is executable. The 
shebang (#!) line can make that work but you'll have to set the x permission on 
the perl file to make it work.

chmod +x  path/to/TitleYear.pl

is the appropriate shell  command.

perl is not so hard to learn. It helps if you know some C but learning perl can 
help make you into a C programmer. Lots of books and internet content are 
available.
-- 

--  Halloween  == Oct 31 == Dec 25 == Christmas  --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: how to paste in a specific column

2010-10-14 Thread Doug McNutt
At 18:32 +0100 10/14/10, John Delacour wrote:
At 08:33 -0700 14/10/2010, jtk wrote:

Has anyone figured out how to automatically place a character (e.g.,
) in the same column of selected lines? This would be really useful
for Fortran continuation lines. So far I can't see how to do it other
than spacing one by one over from the end of the text to column 73,
which is really tedious if you're updating old code with a lot of
continuation lines.

I don't see quite what you're wanting to do

Neither do I.  The last time I ordered a continuation in FORTRAN it was on a 
Hollerith card in column 6. Sequence numbers begin in column 73 for sorting of 
a dropped deck. I'm pretty sure that modern compilers allow for long lines.

You need to punch a tab control card and insert it on the drum at the top of 
the 026 card punch. That way the tab key on the keyboard will move the blank 
card to the right spot.

Seriously though, the best way to edit and otherwise muck with card images like 
that is with a spreadsheet. Second best is Nisus 5 on a classic mac like this 
8500. I have been recently told that emacs allows real tab stops but I haven't 
yet figured out how to set the required configuration options. 

It's fairly easy, on a spreadsheet, to prepare formats that convert columns to 
data plus spaces that guarantee character spacing assuming constant width.  
Excel's REPT( ) function, for instance.

The folks are Bare Bones have never agreed with me that variable width tab 
stops are meaningful.

-- 
--  The best programming tool is a soldering iron --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: how to paste in a specific column

2010-10-14 Thread Doug McNutt
At 17:09 -0700 10/14/10, jtk wrote:
Thanks for all the replies, and for reminding me that I'm a complete
dinosaur for still programming in Fortran ;^. Obviously Doug you
haven't had to program in Fortran 90/95. Official form for
continuations is to put an ampersand in col. 73 of the first line and
another one in col. 6 of the continuation line. The second part is
what's always been done, but the col. 73 bit is a royal PITA.  If
there are a variable number of existing characters in each line, which
is the case here since I am editing existing code, I am not sure
John's script will work. Luckily I am just doing this in a short code
so it won't kill me to edit by hand, but I was hoping for a better
solution for future occasions when I have to update more massive
programs.


I smell a perl script as a preprocessor before compiling.

You just forget about the stuff in column 73 and use perl to delay a line and 
add the  in 73 to a card that comes before a card with something in column 6.

You could also get creative with tab characters that would be removed and 
replaced with spaces in the perl script.

Come to think of it, you could do that in FORTRAN.

And, you're right. The last FORTRAN code I created was used on the HEAO 
spacecraft launched in 1975.

It's possible to run a perl script on an open but saved file in BBEdit. BBEdit 
will take note of changes made on the copy in memory and reload the revised 
image. You might also just pipe the deck through the perl script as a line in 
your make files.

-- 
-- Give me liberty or give me Obamacare --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Grep Help.

2010-09-09 Thread Doug McNutt
At 11:09 -0700 9/9/10, Bruce Van Allen wrote:
On 2010-09-09, m i l e s wrote:

I have data from a OUTLOOK export that's been corrupted.  It appears that 
Outlook is putting extraneous data from the NOTES field into the TITLE field 
of the export, which ends up column shifting the resulting records that 
follow the first record.

Look at the sample data below: its column shifted the following:
  Low Normal  Web Page

Down to the next line, and anything in the notes field gets stuffed
into the Title field, where there should be nothing at all.

How would I fix this with Grep ?

It's difficult to see the problem because email has broken your lines up.

A few things to try, snipped by DPM


Another thing to try:

Select the lines you posted, or a more original source, and paste them into a 
spreadsheet. Excel, for instance, recognizes the tabs and will place items in 
columns across the page. BBEdit  offers no way to do that.

When I did that I found missing tabs with 135 Lexington Avenue coming under 
Job  Title instead of Business Street.

It's as if someone was adjusting the tabs so that the format would look right 
in his text-oriented display. Converting tabs to spaces could do that and 
create a terrible mess.

Using Excel's insert cells command it's possible to line some things up with 
what BBEdit would think are inserted tabs but you'd be guessing based on 
content and that's hard to automate. With a lot more items you might see usable 
patterns with the real column structure offered by a spreadsheet.

The Jack Hirsch item seems totally unrelated to the headings. It appears on a 
row by itself. The other items have nothing in the Title, column 1.

With all of those columns, mostly blank, you have a pretty good example of what 
xml files are for.

-- 
-- Give me liberty or give me Obamacare --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
Follow @bbedit on Twitter: http://www.twitter.com/bbedit


Re: Sorting a .plist

2010-08-18 Thread Doug McNutt
At 00:39 -0600 8/17/10, LuKreme wrote:
   dict
   keyArchive File Name/key
   stringFaceBlock-1.safariextz/string
   keyBundle Directory Name/key
   stringFaceBlock-1.safariextension/string
   keyEnabled/key
   true/
   /dict
   dict
   keyArchive File Name/key
   stringValidate.safariextz/string
   keyBundle Directory Name/key
   stringValidate.safariextension/string
   keyEnabled/key
   true/
   /dict
   dict
   keyArchive File Name/key
   stringAdBlock-1.safariextz/string
   keyBundle Directory Name/key
   stringAdBlock-1.safariextension/string
   keyEnabled/key
   true/
   /dict

Just for the hell of it I pasted that into a Microsoft Excel spreadsheet 
starting at A2

I put a 0 in A1 and a 1 in B2. Those columns would have nothing in them because 
of the tabs in the source. BBEdit doesn't handle tabs the way spreadsheets do.

in A2, I put the formula  =IF(C2=dict,A1+1,A1) , 
=IF(C2=dict,A1+1000,A1+1) might be better.
In B2, I put the formula  =IF(C2=dict,D4,B1)

Then fill down starting at A2:B2 as far as you want to go.

Copy all of the filled down cells and paste-special, values into the same area. 

Now sort all of the data rows first by column B and then by column A.

3   stringAdBlock-1.safariextz/string   dict  
3   stringAdBlock-1.safariextz/string   keyArchive File 
Name/key
3   stringAdBlock-1.safariextz/string   
stringAdBlock-1.safariextz/string
3   stringAdBlock-1.safariextz/string   keyBundle Directory 
Name/key
3   stringAdBlock-1.safariextz/string   
stringAdBlock-1.safariextension/string
3   stringAdBlock-1.safariextz/string   keyEnabled/key
3   stringAdBlock-1.safariextz/string   true/
3   stringAdBlock-1.safariextz/string   /dict 
1   stringFaceBlock-1.safariextz/string dict  
1   stringFaceBlock-1.safariextz/string keyArchive File 
Name/key
1   stringFaceBlock-1.safariextz/string 
stringFaceBlock-1.safariextz/string
1   stringFaceBlock-1.safariextz/string keyBundle Directory 
Name/key
1   stringFaceBlock-1.safariextz/string 
stringFaceBlock-1.safariextension/string
1   stringFaceBlock-1.safariextz/string keyEnabled/key
1   stringFaceBlock-1.safariextz/string true/
1   stringFaceBlock-1.safariextz/string /dict 
2   stringValidate.safariextz/stringdict  
2   stringValidate.safariextz/stringkeyArchive File 
Name/key
2   stringValidate.safariextz/string
stringValidate.safariextz/string
2   stringValidate.safariextz/stringkeyBundle Directory 
Name/key
2   stringValidate.safariextz/string
stringValidate.safariextension/string
2   stringValidate.safariextz/stringkeyEnabled/key
2   stringValidate.safariextz/stringtrue/
2   stringValidate.safariextz/string/dict 

Blank out columns A and B then copy and paste back into BBEdit.

You might want to use  =IF(C2=dict,A1+100,A1+1)  of some other changes to 
fit the actual data.

And the really good way is to become an expert with hashes of arrays in perl 
but that takes some learning time.
-- 

-- In Christianity, man can have only one wife. This is known as monotony. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: Flip a Table

2010-07-05 Thread Doug McNutt
At 10:37 -0700 7/5/10, Warren Michelsen wrote:
I have tables containing data in reverse chronological order. I'd like it to 
be chronological so I'm thinking I can just move the table rows around.

Seems like it would require a separate scratch file to hold the re-ordered 
rows until all rows have been copied, then replace the selection with the 
re-ordered rows.

I.e., Take the last table row (cutting or removing it) from the selection and 
move it to the scratch area.

Take the last table row and move it to the end of the scratch area. 
Lather, rinse, repeat until all rows have been cut from the original
Then move the scratch contents to the original document.

I'm guessing that Perl is the best tool for this job. It has a reverse 
function so I'm guessing that the original selection could be read into an 
array, using tr and /tr as delimiters, then regurgitated in reverse 
order of the original.  

If the stuff between tr and /tr has a numeric value or a date between 
embedded in the rows with td and /td flags it would be fairly simple to 
store each row in a perl hash keyed to the date item.

It's then a standard operation to pick up the keys in a sorted array which can 
be sequentially used to recall the strings from the hash in any order you want.

I have done things like that but it's probably easier to start afresh than to 
look for old code.  Ask. off line but leave the subject as-is to get by filters.

-- 
-- Give me liberty or give me Obamacare --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: Column insert on uneven lines

2010-06-06 Thread Doug McNutt
At 13:31 -0600 6/6/10, LuKreme wrote, and I snipped a bit:
Something I do quite a bit is take a file like this:

file1.txt
file2.txt
file3.txt

and a file likes this:

Fred
George
Alex

and convert it to 

mv file1.txt a long filename - 1 - Fred.txt
mv file3.txt a long filename - 2 - George.txt
mv file3.txt a long filename - 3 - Alex.txt

I do this by running one search replace, and then doing a column insert right 
before the .txt of the list of names.  This works great and I have no problems 
with it, unless the filenames are of differing lengths:

fileone.txt
filethree.txt
filefourteennintytwo.txt

and I end up with 

mv fileone.txt fileone - .txt
mv filethree.txt filethree - .txt
mv filefourteennintytwo.txt filefourteennintytwo - .txt

and I can no long insert the lines from the second file into the appropriate 
place in this file.

Where I need to insert the names may change depending on what I am working 
with, and it could be in the middle of a long file name like

mv 2010-05-27 AM.txt 2010 Annual Meetings Notes - George - 20100527.txt
mv IT meeting 2010 04 17 2010 IT Meeting Note - Alex - 20100417.txt

I have had problems like that since I first started with BBedit. That was when 
I could no longer use MPW on OS neXt.

The answer to my request for tab stops like a typewriter has always generated 
the response If you need a WORD processor, use one.  All I want is the 
equivalent of an 026 card punch.

I typically use an Excel spreadsheet as a text editor for what you're talking 
about. It does understand the ASCII tab character. Another option is Nisus 5.1 
or earlier for OS 9 and below. Yet another option is to become fluent with 
perl. After the learning curve what you're doing will seem simple and it can do 
the mv command without worrying about a bbedit worksheet or a separate terminal 
session.

-- 

--  Halloween  == Oct 31 == Dec 25 == Christmas  --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: [ANN] BBEdit 9.5

2010-04-27 Thread Doug McNutt
On Apr 27, 2010, at 9:24 AM, Rich Siegel wrote:
A complete digest of the changes is available here:
http://www.barebones.com/support/bbedit/arch_bbedit95.html

That link shows:

 If you are using the expert preference to save state in the document's 
 resource fork (rather than in a central location), please note that the new 
 format state data is not actually saved in a resource anymore - it is now 
 written into an extended attribute, which you can verify from the command 
 line using @xattr -l /path/to/some/f...@.


I'm limited to OS 10.3.9 for other reasons so it doesn't matter right now but 
that scares me.

I save BBEdit preferences for files in the resource fork with confidence that 
when I use a simple cp or perhaps an scp or ftp of my file to a Windoze or 
Ubuntu friend he will receive a faithful copy of the text without something 
else appended or even, perish the thought, some plist format that obscures the 
text with multiple line end characters as with a BBEdit worksheet.

If I copy the file to a backup Macintosh server, using a resource-preserving 
method, will it open over a network with the preferences preserved?

Please add some comments with some more details about the change.

And tell me that @ sign in the command line above is only because I'm reading 
this using Classilla on Mac OS 9.1 which likely has problems with unicode. It 
looks like an AT sign in an email address to me.

-- 
-- Give me liberty or give me Obamacare --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: Controlling BBEdit via script other than AppleScript

2010-03-09 Thread Doug McNutt
At 16:05 -0800 3/9/10, Kendall Conrad wrote:
I know how to use AppleScript with BBEdit to move the cursor, replace
content, etc., but can other scripting languages do this as well, such
as Python? I've looked around some, but haven't found anything. I know
about the Run menu and being able to run Python scripts from BBEdit,
but haven't found a way to let Python tell BBEdit to do things like
move the text cursor and replace content at a certain spot.


Apple's osascript UNIX tool allows for short bursts of AppleScript. Python and 
perl can both prepare scripts as text and ask the kernel to execute them.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: File modified on disk warnings - seemingly random

2010-01-29 Thread Doug McNutt
Is it possible that some content-indexing package is hitting the files in 
background? Or perhaps some disk optimizing cron job?

-- 

-- A fair tax is one that you pay but I don't --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: iPad

2010-01-28 Thread Doug McNutt
At 12:46 +1100 1/29/10, Alex Satrapa wrote:
BBEdit and a decent SSH shell are my perfect iPad applications to add to 
what we saw at the demo.

http://www.zinger-soft.com/iSSH_features.html

The X11 feature is labelled coming soon.  I wonder. There is some new 
Apple-proprietary chip in the thing. I wonder if there will be a gcc compiler 
front end for it.

-- 
- The US of A is getting pelloreid -

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: BBEdit doesn't find text in Word headers and footers

2010-01-22 Thread Doug McNutt
At 07:34 -0800 1/22/10, Karen B wrote, and I snipped:
The problem with these programs is that they find file
contents that have been deleted. I guess the deleted text is still
present somehow, but not visible.

WORD is famous for that. There is a special way to save a final version that 
removes the old text which is there to support magic undo operations. Lots of 
folks don't know about saving though and embarrassing text has appeared in 
public places. Those folks who insist on WORD for their forms ought to be told 
about it.

The UNIX strings piped to grep tools might be useful for the search if there is 
something in the headers that you can look for.

-- 

-- In Christianity, man can have only one wife. This is known as monotony. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: How to Run a line of code in external program

2010-01-09 Thread Doug McNutt
At 15:46 -0700 1/8/10, I wrote:
Quoting:

ShellService is a service component - it provides functionality that other 
applications use.In the Services menu (under the application menu), 
ShellService adds an item called Execute Text. This item will be enabled 
whenever you have text selected in applications which support the service. 
When you choose this item, the text will be sent to the command-line shell and 
executed, and the output of the command will be returned to your text 
window.The way that Execute Text works is very similar to (and inspired by) 
the Worksheet window interface of the venerable MPW, Apple's development 
environment on older Mac systems. MPW was the closest thing to a command-line 
many older Macs had, but it has not been updated for MacOS X. Since MacOS X 
has a full UNIX command line, I thought MPW users might enjoy a 
worksheet-style portal to it.ShellService is free. The author welcomes 
feedback.


And there were a couple of links that I was sure were working. But I lied. The 
*.tar.gz file you download turns out to be an error message in HTML after gzip 
expansion. The tar -x  tool just fails quietly.

Christopher Corbell posted the original service in 2002 and declared it 
freeware at the time. All links to it have disappeared. Mr. Corbell seems to 
have published iPiano for the iPhone more or less recently but I'm not up to 
any more googling.

I have made an image of the *.app file that is the service binary as it exists 
on my OS 10.3.9 box and it works with a new user after I create a directory 
Services under $HOME/Library/ if it's not there already.

mkdir  $HOME/Library/Services

The image is at:  ftp://ftp.macnauchtan.com/Software/BBEdit/Services.dmg  86 
KiB

Warning:  I'll have the lady of the house try the service with OS 10.6 but 
BBEdit isn't installed on her machine. The service doesn't require BBEdit but 
it does depend on Next Step's pasteboard concept in which selections are just 
there without an explicit copy operation to a clipboard.

Note to Bare Bones:  The Execute Text service ought to be available wherever 
BBEdit is installed. It is especially useful in TEXT files when the features of 
worksheet, XML, files are needed but the underlying file will be used by other 
applications. How about making it, or your version of it, an option the way the 
bbedit tool is installed?

I want MPW as a real shell for OS neXt !!

-- 

-- The U. S. Census Bureau missed a bet by not counting all of those embryos 
in cold storage. --
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.

Re: How to Run a line of code in external program

2010-01-08 Thread Doug McNutt
At 12:58 -0800 1/8/10, Dennis wrote:
You can download the script here:

http://www.dennisrande.com/downloads/Run%20Shell%20Command.zip

The Execute Text service I spoke about earlier came from:

http://www.apple.com/downloads/macosx/unix_open_source/shellservice.html

But that link is broken.

The service, that shows up in my Application_Services menu seems to be stored in
$HOME/Library/Services/

Understand that I'm stuck on OS 10.3.9 for other reasons. It's quite possible 
that the service doesn't work any more but I would have trouble without it.  It 
may be that Dennis' offering is a replacement.

-- 
-- Marriage and kilo are troubled words. Turmoil results when centuries-old 
usage is altered in specialized jargon --.
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.

Re: How to Run a line of code in external program

2010-01-08 Thread Doug McNutt
The lady of the house found this:

http://wsidecar.apple.com/cgi-bin/nph-reg3rdpty1.pl/product=01326platform=osxmethod=sa/ShellService.tar.gz

by looking at some wayback pages.

http://web.archive.org/web/20050302141626/http://www.apple.com/downloads/macosx/unix_open_source/shellservice.html

There is a FileSize item on that page which links to the ShellService tar file 
by Christofer Corbell (MacHotShot.com)

Quoting:

ShellService is a service component - it provides functionality that other 
applications use.In the Services menu (under the application menu), 
ShellService adds an item called Execute Text. This item will be enabled 
whenever you have text selected in applications which support the service. When 
you choose this item, the text will be sent to the command-line shell and 
executed, and the output of the command will be returned to your text 
window.The way that Execute Text works is very similar to (and inspired by) the 
Worksheet window interface of the venerable MPW, Apple's development 
environment on older Mac systems. MPW was the closest thing to a command-line 
many older Macs had, but it has not been updated for MacOS X. Since MacOS X has 
a full UNIX command line, I thought MPW users might enjoy a worksheet-style 
portal to it.ShellService is free. The author welcomes feedback.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.

Re: How to Run a line of code in external program

2010-01-07 Thread Doug McNutt
At 18:47 -0800 1/6/10, Ben wrote:
G'day all,

I routinely use BBEdit for coding SQL etc, and then have to select,
copy, switch to the terminal window and paste to execute the line.

Is there a way to create a key-stroke that will take the current line
(or selection) and dump it into a nominated window.

I'm guessing it might already exist (many other text editors have this
sort of feature) or it means scripting something up?

(As an example, the R built in editor uses Cmd-Enter to run either the
current line or current selection in the R console. It would be great
to be able to use BBEdit for R as well, see next post...)

Execute Text is a service I found somewhere long ago.  Have a look at BBEdit's 
BBEdit menu and see if there is a usable service already provided by Apple.

Ann then you can use BBEdit worksheets but perhaps not if you need to use the 
file as an input source to SQL later. That capability died with BBEdit 5 or so 
when Bare Bones changed the format of worksheets from simple TEXT to XML.

The worksheet method allows retention of shell variables - like PWD - The 
service concept will spawn a new shell that is ignorant of earlier settings. 
Applescript will do the same thing while insisting that you use sh instead of 
$SHELL.

-- 

-- A fair tax is one that you pay but I don't --
-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.

Re: Shell for worksheet V 8.5

2009-12-18 Thread Doug McNutt
At 09:54 -0500 12/18/09, Patrick Woolsey wrote:
Doug McNutt dougl...@macnauchtan.com sez:

System 10.3.9 with BBEdit 8.5. Can't go higher without new hardware.

I had a disk failure and had to restart a bunch of stuff and now my
worksheets have all been converted from tcsh to bash. How can I get back?
My .tcshrc file is getting executed when Terminal.app comes up in tcsh at
login time.

Even recovered backup copies from an OS 7.5 box now come up in bash.


Shell worksheets use your default shell, so that probably changed during
the system restore. (IIRC in 10.3, the default switched from tcsh to bash.)

To adjust this, use 'chsh', e.g.

chsh -s /bin/tcsh your_username

Nope. Worksheets, but  not Terminal.app, come up with bash. I had previously 
set tcsh using the netinfo manager and chsh reports that it changed the netinfo 
database.

More to the support address.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: Shell for worksheet V 8.5

2009-12-18 Thread Doug McNutt
At 09:34 -0700 12/18/09, Doug McNutt wrote:
At 09:54 -0500 12/18/09, Patrick Woolsey wrote:
Doug McNutt dougl...@macnauchtan.com sez:

System 10.3.9 with BBEdit 8.5. Can't go higher without new hardware.

I had a disk failure and had to restart a bunch of stuff and now my
worksheets have all been converted from tcsh to bash. How can I get back?
My .tcshrc file is getting executed when Terminal.app comes up in tcsh at
login time.

Even recovered backup copies from an OS 7.5 box now come up in bash.


Shell worksheets use your default shell, so that probably changed during
the system restore. (IIRC in 10.3, the default switched from tcsh to bash.)

To adjust this, use 'chsh', e.g.

chsh -s /bin/tcsh your_username

Nope. Worksheets, but  not Terminal.app, come up with bash. I had previously 
set tcsh using the netinfo manager and chsh reports that it changed the 
netinfo database.

More to the support address.
-- 

It's over 9 hours later and I have nothing but experiment with BBEdit and 
friends.
 I may have a solution though:

defaults write com.barebones.bbedit Services:DefaultUnixShell /bin/tcsh
defaults write com.barebones.bbedit State:UseResourceFork -bool YES

May have solved the problem but I'm not sure if BBEdit will still work for 
another user who has his shell pointed elsewhere.  com.barebones.bbedit does 
not appear in the Library directory of my home folder.  I shall look for it 
some more in the morning. Start with man defaults. Does anyone use worksheets 
in Tiger and above?

It's likely that those preference items were previously set in an older version 
of BBEdit and they were carried on in version 8.5.2.

It is definitely NOT true that BBEdit defaults to the user's shell. I wonder if 
it ever did?

Nighty night.
-- 
-- So do we celebrate the start of a new decade at the end of this year? Or do 
the tens start at in January 2011? Was the first year,  ACE, assigned Roman 
numeral I ?--

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Shell for worksheet V 8.5

2009-12-17 Thread Doug McNutt
System 10.3.9 with BBEdit 8.5. Can't go higher without new hardware.

I had a disk failure and had to restart a bunch of stuff and now my worksheets 
have all been converted from tcsh to bash. How can I get back?  My .tcshrc file 
is getting executed when Terminal.app comes up in tcsh at login time.

Even recovered backup copies from an OS 7.5 box now come up in bash.

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

-- 
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.


Re: FTP File Mappings?

2009-11-09 Thread Doug McNutt

At 08:19 -0800 11/9/09, Bee wrote:
Since ascii transfers convert line endings and
line endings are not important to html and
most modern text editors and word processors do not care...

I transfer everything binary because
I do not want ftp or anything else messing with my files.

AMEN.

ftp in ASCII mode converts line endings to internet standard \r\n and it's up 
to the receiving computer to know what it wants and convert back.

Things like an XML file in which tags have line endings but its OK to have a 
tag introduce binary content in a file that might look a lot like ASCII to an 
ftp server are a total disaster when a binary octet gets changed because it 
happens to be 0D or 0A.

The server has as much of a problem determining if the file is binary or text 
as the OP did.

If, however, you're writing a cgi script in perl on a classic Mac, with an old 
copy of BBEdit of course, you can safely deliver the script to your UNIX web 
host using ASCII mode to change those 0D's to 0A's. The point is that you know 
what the file to be delivered looks like.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

--~--~-~--~~~---~--~~
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
-~--~~~~--~~--~--~---



Re: alternative to /r for linebreaks?

2009-11-08 Thread Doug McNutt

At 13:10 -0800 11/8/09, Michael Heth wrote:
This is probably rudimentary but I can't find what I need so I thought  
I would ask.

I am massaging 11K emails that were in a proprietary archive database.  
They were exported as a large text file. The field delimiters were  
high ASCII characters as there might be embedded tabs and CRs. So now  
I am trying to get the emails ready for importing into a proper  
database. I need to find something that will preserve linebreaks but  
that isn't something that would be recognized as the end of the record  
like the CR.

I want to search for CR and replace with something else. Then I can  
change my field delimiters and add back the CRs at the end and I  
should be good to go.

But I only know \t and \r, is there a sequence for what I need?

First of all, be aware that bbedit converts all line breaks it identifies as it 
reads a file to \r which is the older Apple standard carriage return, Hex 0D. 
(Actually it's probably a 000D to get 16 bit unicode equivalents..)

The other line end is \n or hex 0A which is the UNIX standard. Now that Apple 
IS BSD UNIX that is pretty much the standard except for old files.

peecees use a \r\n pair which is the internet (and teletype of old) standard.

Be aware that in the classic Apple OS the meanings of the escapes \r and \n are 
swapped. That shouldn't bother you unless the escapes actually appear in the 
files.

Personally, I'd run to perl where I can set the lineend character(s) to 
anything and then read the file record by record using those high ASCII codes 
which I hope you know.  $/ = \255;, with the right code, should do it.

Is there any way to do that with bbedit? A perl factory to read a file? Those 
embedded tabs and line ends might well be mixed versions coming from divers 
mail clients.
-- 

-- In Christianity, man can have only one wife. This is known as monotony. --

--~--~-~--~~~---~--~~
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Scripting Line Prefix

2009-10-30 Thread Doug McNutt

At 17:41 -0400 10/30/09, Ronald J Kimball wrote:

The actual title of the Camel Book is Programming Perl.

At 15:42 -0500 10/30/09, Christopher Stone wrote:
On the Perl topic does anyone have recommendations for online resources and 
books for a rank beginner?

There is also a smaller O'Reilly book called Learning Perl. It's older but 
perhaps more in tune with the rank beginner.


-- 

--  Halloween  == Oct 31 == Dec 25 == Christmas  --

--~--~-~--~~~---~--~~
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
-~--~~~~--~~--~--~---



Re: grep help, delete everything other than what I'm matching

2009-10-28 Thread Doug McNutt

At 09:30 -0700 10/28/09, BB Design wrote:
I'm using BB Edit grep to select a/a links like this:

(\a.*\\/a)

So I can paste the match using: \1

However, I basically want to delete everything else in the document
except these links, so that all I am left with is the links. Possible
to modify my code to accomplish this? Thanks!

First: you better make sure that regular expression isn't greedy. It's likely 
to select everything from the first a to the last /a in the line or possibly 
to the end of the file.

(\a.*\?\/a)

and next you'll need to allow for links that pass through lineend characters 
unless you know a lot about the structure of the html file.

In my favorite language it would be an s after the trailing quote of the 
overall expression, /a.*?\/a/is. In BBEdit it's (\s) or something like that 
at the end of the expression.

-- 
-- So do we celebrate the start of a new decade at the end of this year? Or do 
the tens start at in January 2011? Was the first year,  ACE, assigned Roman 
numeral I ?--

--~--~-~--~~~---~--~~
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Is there a way to duplicate a line?

2009-10-22 Thread Doug McNutt

At 14:52 -0700 10/22/09, Dennis wrote:
On Oct 22, 2009, at 2:35 PM, daedalus wrote:
 Is there a built-in way I'm just overlooking or a macro or
 something I can do that would allow me to accomplish this?

Easily done with a script:

If you turn it on BBEdit will select a whole line with a single click when the 
mouse is positioned at the very left end of a line. The editing cursor changes 
to a left pointing arrow.

It's really handy for worksheets when you want to execute a line but it would 
also work for a select, copy, paste, paste sequence.

-- 
-- So are we going to celebrate the start of a new decade at the end of this 
year? Or do the tens start at in January 2011? --

--~--~-~--~~~---~--~~
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Line endings with Unix servers

2009-10-01 Thread Doug McNutt

At 08:54 -0500 10/1/09, Rod Buchanan wrote:
And I snipped it all

The problem I have with BBEdit, and I'm limited to OS 10.3.9 for other reasons, 
is that there is absolutely no way that BBEdit will allow me to work with files 
that have mixed line ends for perfectly good reasons.

It is most important to me because I need to handle ASCII text files that are 
the result of connections to divers electronic measurement devices that offer 
line ends which include all three options but get mixed up in the download 
process.

But recently I have tried to intercept the error output from the well-known 
/usr/bin/curl tool.  It uses carriage returns, \r in UNIX systems,  to return 
to the left side of a window with the deliberate intention to overwrite the 
previous line with new data.  When it issues a \n code it expects the shell to 
drop down a line. It's much like the ASR 33 that I once learned to lov except 
that teletype demanded \r\n for that purpose (well. . . the \r and \n were 
really 5 bit codes).

It is impossible to use BBEdit to intelligently interpret a redirected output 
file produced for debugging. My guess, unconfirmed, is that BBEdit looks at the 
first few line ends and assumes all the rest will be the same.

Yes. I can preprocess with perl scripts but other software simply accepts  all 
possible line ends, leaves them in the file, and then allows editing and 
eventually  saves of the file that manage to preserve line ends so that what 
came is what goes out.

-- 
-- The message came to Abraham that he would beget a son. Sarah, who was 
behind the door, laughed. --

--~--~-~--~~~---~--~~
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 bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
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 supp...@barebones.com rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Fixing bad Camel-Case URLS

2009-08-24 Thread Doug McNutt

I'm not so sure it's a complete solution but you should remember that you can 
make links, hard variety to files and symbolic variety for directories.

man ln# for more on a Linux box.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: size limit for text files ?

2009-08-07 Thread Doug McNutt

At 10:14 -0400 8/7/09, Patrick Woolsey wrote:
http://faq.barebones.com/do_getanswer.php?record_id=36

BBEdit and TextWrangler represent open documents as Unicode, which uses two 
bytes for each character. Combined with an internal Mac OS X limitation, this 
means that you can open files up to 384 megabytes in size (402,653,184 
characters).

I was into that some time ago and decided I was being too pedantic but. . .

The character count appears to be 384 * 1204^2 which would be mebibytes. It's a 
shame to have to ask but the Computer Science folks made a serious mistake when 
they usurped the metric abbreviations likely well known to users of text 
editors. Many users would wonder if the author made a mistake in multiplication.

And what if the source file is encoded as U-16 or U-08? Can BBEdit open an 805 
megabyte file with a 16 bit BOM? Is it limited to files even smaller than 402 
megabytes if it is UTF-08 with a large number of three byte characters? Does 
BBEdit read the entire file into memory and then convert it to U-16? If so is 
it an in-place conversion?

The thought of encountering a U-32 file is scary. What happens if a file is 
split in the middle of a two-byte character?

In short is the limit  402,653,184 bytes of  file size or 402,653,184 
characters as preprocessed by BBEdit?

I know. The answer is all that is proprietary.  sigh.

-- 
-- Marriage and kilo are troubled words. Turmoil results when centuries-old 
usage is altered in specialized jargon --.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Script to convert CSV to formatted plain text table

2009-06-16 Thread Doug McNutt

Assuming the OP meant, by ASCII table, a flow of text that will appear in a 
BBEedit window as a table the real answer is no way.

It might be possible to demand a constant width font and add space characters 
to make such a file appear as a table of sorts but editing the contents would 
be nearly impossible. There is a UNIX tool - entab - that does things a bit 
like that but it wouldn't be perfect.

BBEdit just does not support typewriter style tab stops for its windows.  Sigh.

If the OP means an HTML table, that's another thing.

 I use a spreadsheet for tab separated data. Comma separated is easy to convert 
to tabs unless there are commas in the data that need protection by escaping.

-- 
- Stocks have been pelloreid -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Script to convert CSV to formatted plain text table

2009-06-16 Thread Doug McNutt

At 16:18 +0100 6/16/09, Carlton Gibson wrote:
I meant to take something like this:

col1,col2,col3
xx,xxx,x

and turn it into something like:

***
* col1 * col2 * col3  *
***
* xx   * xxx  * x *
***

Readers:  Switch to a constant width font in your display to see what he means.

perl has an x= operator. That's a small ASCII x that creates a string of 
characters x items long. It's like a += operator that adds a number to the left 
argument and replaces it. Page 107 in the Camel book.

$string =  ;
$string x= 5;

I would think it possible to look for regular expressions like /(\w+),/ and 
replace with $1 concatenated with $colwidth -len($1) spaces. In English that 
says search for any number of word characters followed by a comma and set 
variable $1 to the word characters as a string. Then add spaces as required to 
make up the column width and replace.

As a stand alone perl script with a while loop is ought to be fairly simple. I 
would probably scan the entire file as a single string variable and push 
results, one by one, onto a new string. You would have to scan the file first 
to produce a list of column widths.

Making it work as a BBEdit search and replace is another thing but it might be 
possible.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: BBEdit capabilities and scripting

2009-06-16 Thread Doug McNutt

At 17:40 -0700 6/16/09, Tim Gray wrote:
A whole lot of good stuff

Amen!

Let's have a real UNIX connectivity. Have a look at Linux' gedit tools. They 
are anything but perfect but a wise software supplier could easily increase the 
capabilities of the linkage. And there are those who accept only gnu free 
software but I am not one of them.

I keep thinking that I should just dot it but at age 74 I worry that I just 
can't get it all done myself.
-- 

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Where Can I Find the HTML Language Module

2009-06-11 Thread Doug McNutt

At 06:52 -0700 6/11/09, Jonathan Pool wrote:
 We've found that hiring someone who's willing to study the ins
 and outs of the language in question and implement an expert
 solution has worked very well

Except when it hasn't. BBEdit mistreats Perl regular expressions.


I'm stuck on OS 10.3.9 for hardware reasons so I can't contribute much but. . .

Someone might like to check for syntax coloring, in perl, of the  operator 
meaning a binary shift left. There is confusion in another editor (OK, it's 
gedit) with the perl usage of the same symbol pair for introducing a perl-style 
HERE document. Figuring a workaround is painful because one really has to look 
ahead for the ending string that terminates the HERE string after a few line 
ends.

There is a convention in gtksourceview that syntax coloring is defined in an 
XML file named perl.lang and similarly for other languages. The format is a 
fairly nasty list of regular expressions with defined variables that are 
handled by the display code. I was able to muck with perl.lang and repair the 
display for my own purposes but the result isn't perfect because it places 
restrictions on just what can be in a HERE document. Well: they're deprecated 
in the Camel book.

Someone has said only perl can compile perl.  I agree.
-- 

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Using SSH with BBEdit

2009-05-05 Thread Doug McNutt

At 14:10 -0700 5/5/09, Bruce Van Allen wrote:
So I'd love to hear from anyone on 
this list if you have a favorite practice with SSH, or can point 
me to useful resources. (Post here so others might benefit as well.)

BBEdit worksheets work well with the scp flavor of ssh but they're not so good 
with an ssh shell that may want typed-in feedback for some things.

If you create a public/private key pair with ssh-keygen and put the results in 
your home folder's .ssh directory, which you might have to create, you can 
populate $HOME/.ssh/authorized_keys, on your hosting site, with your public 
key. Note that dot in .ssh. Apple's Finder will want to hide that from you. You 
can make a link to it with 

ln $HOME/.ssh $HOME/_ssh

With that done and probably some messing with keychains or the ssh-add tool 
you'll find that commands like

scp localfiles*.txt   yourhost:/

placed in a BBEdit worksheet for reuse will be easily executable. It beats ftp 
because wild cards are allowed. If you want the wild card to apply on the 
external host, include it in quote marks so your local shell doesn't try to 
interpret them.

Actually, I tend to place my scp commands in commented form right into html 
files. There's nothing secret about them and you can copy and paste the line 
into a shell window or a BBEdit worksheet for execution.  (And yes. I really 
wish we could execute them from within the html file as displayed by BBEdit but 
that went away in BBEdit 6 or so.) It's a whole lot easier to copy and modify 
an existing scp command in a worksheet than it is to type it completely into a 
shell window.

You can also do things like

ssh  yourhost: ls

to return stdout into your worksheet. Just don't try anything that will ask you 
for input.

You will probably want to set up, in $HOME/.ssh, a config file that can be used 
to provide your username on the remote host and perhaps an IP address.

Be careful though. There is no automatic conversion of line ends as there can 
be with ftp. You'll have to have them right before you upload.

-- 
- Stocks are getting pelloreid -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Find / Replace or insert text

2009-05-04 Thread Doug McNutt

At 10:57 -0700 5/3/09, RichF wrote:
Not sure how to do this.
I want to insert text after position 72 in selected lines even if the
line is shorter than 72 characters.
Any help always appreciated.


I can't resist it:

You need to set 7/9 punches in column 72 of the wrap around control card that 
goes in the drum at the top of the 026 punch.

Once you do that you can punch FORTRAN sequence numbers automatically.


Other than that, perl has an x operator that allows a numeric repetition count 
of a string which could be used to create n spaces in a replacement text string.

-- 
-- Marriage and kilo are troubled words. Turmoil results when centuries-old 
usage is altered in specialized jargon --.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Find word delete line

2009-05-02 Thread Doug McNutt

At 19:14 +0100 5/2/09, John Delacour wrote:
#!/usr/bin/perl
my $word = something;
while () { /$word/ or print }

Noting is ever simple.

That would need modification to handle the case there the letters constituting 
$word appear within another word that has more characters than $word.

while () { /\W$word\W/ or print }

Is a start requiring that $word be surrounded by two non-word characters but  
will fail when $word begins or ends a line.

There's also the problem that perl's definition of a word character includes 
programming conventions, particularly the underscore.

BBEdit probably does a better job of understanding the OP's actual desires. 
What if he actually wants to include hyphenated instances which include -\n ?
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Jack Stewart's word wrap works...

2009-04-01 Thread Doug McNutt

At 18:50 -0500 4/1/09, Bill Hernandez wrote:
Well that didn't work...

The only other thing I noticed was that he is using gMail, and may be
bypassing some wrapping filter

I hope somebody figures this out. It would be nice to have mail that
didn't hardwrap...

Jack, if you're reading this, how about sending a copy of what you 
sent to the group directly to me with as much identical as possible.

Google does muck with the header lines and I'll be able to see what 
might be different. before they do their thing.
-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Mixed unicode and ASCII

2009-03-21 Thread Doug McNutt

I have long been frustrated by BBEdit's refusal to edit files that, 
for good reason, have different line end characters throughout - like 
BBEdit Worksheet files for instance.

Now I have another similar problem. Adobe has changed the format of 
its .fdf, form data, files. For almost a decade I have been filling 
out  US tax forms by creating fdf files with Excel macros. I could 
download the PDF blanks from the USIRS web site and Acrobat would 
politely load the data from the fdf files.

The new format mixes not line ends but UTF16 and ASCII encoding in 
the same file! Needless to say, BBEdit doesn't handle it well.

Here's what the first few lines looks like when opened with BBEdit

%FDF-1.2
%’“¦
1 0 obj

/FDF

/Fields [

/V (œ  l i n e   1 4)
/T (œ  f 1 _ 0 5 8 \( 0 \))


/V (œ  l i n e   1 5)
/T (œ  f 1 _ 0 6 0 \( 0 \))


/V (œ  l i n e   6)
/T (œ  f 1 _ 0 4 2 \( 0 \))

Here's the hexdump of the same first few lines produced by BBEdit

: 25 46 44 46 2D 31 2E 32 0A 25 E2 E3 CF D3 0A 31   %FDF-1.2.%’“¦.1
0010: 20 30 20 6F 62 6A 20 0A 3C 3C 0A 2F 46 44 46 200 obj ../FDF
0020: 0A 3C 3C 0A 2F 46 69 65 6C 64 73 20 5B 0A 3C 3C   ../Fields [.
0030: 0A 2F 56 20 28 FE FF 00 6C 00 69 00 6E 00 65 00   ./V (œ .l.i.n.e.
0040: 20 00 31 00 34 29 0A 2F 54 20 28 FE FF 00 66 00.1.4)./T (œ .f.
0050: 31 00 5F 00 30 00 35 00 38 00 5C 28 00 30 00 5C   1._.0.5.8.\(.0.\
0060: 29 29 0A 3E 3E 20 0A 3C 3C 0A 2F 56 20 28 FE FF   )). ../V (œ 
0070: 00 6C 00 69 00 6E 00 65 00 20 00 31 00 35 29 0A   .l.i.n.e. .1.5).
0080: 2F 54 20 28 FE FF 00 66 00 31 00 5F 00 30 00 36   /T (œ .f.1._.0.6
0090: 00 30 00 5C 28 00 30 00 5C 29 29 0A 3E 3E 20 0A   .0.\(.0.\)). .
00A0: 3C 3C 0A 2F 56 20 28 FE FF 00 6C 00 69 00 6E 00   ./V (œ .l.i.n.

It appears that the parentheses that are not escaped designate blocks 
that are encoded as UTF16. They begin with an FEFF code point which 
is surely a byte order mark. After that there are 16 bit entries the 
first byte of which is a null for every file I have looked at.  The 
escaped parentheses are there because the author of the PDF used 
parentheses in his definitions of the form names. Note though that 
the backslash escape character is preceded by a null but the 
parenthesis following it is not.

So my question is. . .  Is there any way I can make use of BBEdit to 
post process the plain ASCII files produced by my Excel macros and 
create a version with the mixed ASCII and UTF16? An AppleScript would 
be an easy way to go and I care not a whit about speed. Can I tell 
BBEdit to change from U16 to ASCII and back as it writes a file? 
BBEdit uses U16 internally for everything. When it reads my fdf file 
does it convert 0066 ( an f ) to  0066? or does it leave the 16 
bits alone by effectively ignoring the null character in the file?

I have looked at reworking my VBA code and that will be a pain. There 
seems to be no way to handle nulls inside of a worksheet cell. Perl 
will probably handle the task and I have started that but perl's use 
unicode options are not helpful. There is also UNIX sed which might 
work with a bunch of successive substitutions.  Any other ideas? 
This is a once a year project and I really don't want to use C for it.

-- 
- Stocks are getting pelloreid -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Batch change of line feeds

2009-03-19 Thread Doug McNutt

At 17:40 -0500 3/19/09, Doug Pinkerton wrote:
I routinely receive clusters of files with Unix or Windows returns,
and need to change them all to Mac. Is there a way to do this on all
of them at once?

You might like this piece of doggerel. Drag and drop AppleScript.
ftp://ftp.macnauchtan.com/Software/LineEnds/FixEndsFolder.sit  52 kB
-- 
- Stocks are getting pelloreid -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



Re: Files open in IE as the default

2009-03-03 Thread Doug McNutt

At 21:13 -0600 3/2/09, Jim Chaffin wrote:
Just do a Get Info on a 'BBEdit file' and select BBEdit as the 
preferred app to open them. Then click the Change All... button.

You can still use type and creator. The SetFile developer tool still 
works. You can just put the SetFile tool in $HOME/bin/ as I have done 
below if you don't want to use the disk space for the full developer 
tools installation.

SetFile -t TEXT -c 'R*ch'

One thing you don't want to do is to use Finder's Get Info box 
without using the change all option.  That will add about 50 kB of 
application icons to the resource fork of each file you reset that 
way.

Save this AppleScript as a drag and drop application:

on open (argList)
repeat with theAlias in argList
set thePath to quoted form of POSIX path of theAlias
--  display dialog thePath
set creatorcode to 'R*ch'
--  display dialog creatorcode
set command to /Users/doug/bin/SetFile -t TEXT -c   
creatorcode  space  thePath
--  display dialog command
do shell script command
end repeat
end open

-- 

-- From the U S of A, the only socialist country that refuses to admit it. --

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups BBEdit Talk group.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a specific feature request or would like to report a suspected (or 
confirmed) problem with the software, please email to supp...@barebones.com 
rather than posting to the group.
-~--~~~~--~~--~--~---



  1   2   >