Re: splitting a text document into chunks found by search

2012-05-31 Thread Christopher Stone
On May 30, 2012, at 21:13, e2o wrote:
 Is there a way to automatically create new BBEdit documents for each chunk of 
 text that is selected by a Find command? I have a document with a ton of 
 multi-line chunks, with the format:
__

Hey Eric,

That's not too difficult.

If you're going to create tons of documents then you may want to write them to 
disk rather than just opening new unsaved documents as I have done here.

--
Best Regards,
Chris


try
  
  set regEx to ^\\*(?s)[^\\*]*
  set foundFlag to true
  tell application BBEdit
set frontDocID to ID of front text document
tell text of document id frontDocID
  select insertion point before character 1
  repeat while foundFlag = true
set findRecord to find regEx options {search mode:grep, case 
sensitive:false} with selecting match
set foundFlag to found of findRecord
if foundFlag = true then
  tell application BBEdit to make new document with properties 
{text:contents of found object of findRecord as text}
end if
  end repeat
end tell
  end tell
  
on error eMsg number eNum
  set {c, s} to {return, --}
  set e to s  c  Error:   eMsg  c  s  c  Error Number:   eNum  c  
s
  beep
  set dDlg to display dialog e buttons {Cancel, Copy, OK} default button 
OK
  if button returned of dDlg = Copy then
set the clipboard to e
  end if
end try




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


alert box doesn't open in bbedit preview?

2012-05-31 Thread David
All,

I have this in my HTML file:

script type=text/javascript
alert('Hello, World!');
/script

However, when I preview this in BBEDIT, the alert box doesn't pop up
(it does if I open the file in Safari). Should it pop up in the BBEDIT
previewer, and if so, are there some preferences I have to set to get
it to work?

Thanks

David

BBEdit
a product of Bare Bones Software, Inc.
version 10.1.2 (3152)

-- 
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: splitting a text document into chunks found by search

2012-05-31 Thread e2o
On May 30, 10:32 pm, Christopher Stone listmeis...@suddenlink.net
wrote:
 That's not too difficult.
 If you're going to create tons of documents then you may want to write them 
 to disk rather than just opening new unsaved documents as I have done here.
 --- 
 -

Thank you for that! I had hacked together a Keyboard Maestro macro
that was getting there, but I'll study this.

Thanks again,  - eric

-- 
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: Remote file path mapped to local

2012-05-31 Thread Govinda



 You know, I really would like to know why it is that people insist on 
 posting incredibly detailed bug reports to this forum, rather than sending 
 them to Bare Bones technical support. 

 

 [snip]

 Anyway. Just wondering, really.


Hi Mike,

I suppose you would have to hear from many such separate individuals who 
have done that (or do that), to know.  ...and I don't recall ever posting 
my (one or two in my life) BBedit bug report(s) on this list/group, BUT I 
can imagine I can identify with some of the BBedit group members' 
individual/collective consciousness.. when I say:

Maybe the feeling is kind of like this:

Darn it; I have a problem.. and I don't know if the cause is:


   - my own idiocy
   - my own lack of homework
   - my own custom/broken environment
   - BBedit's fault
   - other / act of God


...and I don't like to be a fool in front of the amazing wizards who make 
software like BBedit, especially since they might scold me, or worse, then 
they might not feel motivated to really do their part if they have to deal 
with too many people like me... and I want them to do their part, whatever 
that looks like.  But here on the list, we are all idiots and compassionate 
people and skilled people - together in one big understanding happy family. 
  PLUS maybe someone already has had the same problem as me, and they would 
like to tell me the solution, whatever the cause of the problem, ... and I 
am allowed to ask for that here on the list, ... but in official support 
channels I am only allowed to (properly) ask when the problem is likely to 
be BBedit's fault, and I have not reached the conclusion that that is the 
case... and meanwhile I just need help with this, now; I need to get back 
to work; I have no time to research to find out if I can 'legitimately' be 
bothering support.


Just one of my guess(es).
-Govinda

-- 
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: Remote file path mapped to local

2012-05-31 Thread Lee Hinde

On May 30, 2012, at 1:47 AM, Mike Conley wrote:

 
 
 On Monday, 28 May 2012 06:57:21 UTC+1, eddyk wrote:
 [...] Problem of incorrect file path resolution in 10.7.4  is present on iMac 
 i3 and MacBook Pro, for all users. Repairing permissions, reinstalling using 
 Mac 10.7.4 combo do not resolve the issue.
 Any ideas ? Thanks.
 
 You know, I really would like to know why it is that people insist on posting 
 incredibly detailed bug reports to this forum, rather than sending them to 
 Bare Bones technical support. I mean, as someone who has to deal with 
 technical support issues myself, I'm quite curious. Is it just a mistrust of 
 the official channels? Is it that people send in reports and get no response 
 and are thus frustrated? Is it just plain ignorance? Is it the fact that the 
 Google Groups facility doesn't make it easy to shove the 'contact technical 
 support' notice in people's faces?
 
 And I wonder whether BB have simply given up and now consider this forum (and 
 the others) as simply an alternative to the tech support e-mail address. I 
 mean, I would be sorely tempted to do so -- at least if any significant 
 fraction of my bug reports came through this channel rather than the 
 recommended one.
 
 Anyway. Just wondering, really.
 

I don't know if it's the motivation, but it helps me in six months when I have 
the same problem and I can google it and find a thread and maybe figure it out 
without bothering anyone else.


-- 
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: can anyone help me with a slavish job?

2012-05-31 Thread Matt Martini

On May 25, 2012, at 7:34 AM, thegermanguy wrote:

 Hi everyone
 
 my boss just came down on me with a slavish task and I was hoping
 someone here had an easy (scripting?) solution for it. I've never
 written a line of code, so please forgive if my expectations are
 unrealistic.
 
 I hava a huge file and need to change things repeatedly in the
 following manner:
 
 The lines I need to change ALWAYS follow a line saying
 
 MTypeName `Index' (so easy to find)
 
 Then the line I need to change reads for example
 
 MText `N.: suprascapularis'
 
 and needs to be changed to
 
 MText `N. suprascapularis; Nervus suprascapularis'
 
 i.e.
 
 - delete the colon after in this example the N.
 - insert a semicolon before the  ' 
 - repeat the term
 - but replace the N. with Nervus (or, if it's a V. with Vena
 and there are about 8 different possibilities to be replaced with
 different words)
 
 I Imagine for someone who knows what they are doing, this should be a
 ridiculously simple task, needing a few lines of code. For me, on
 foot, so to say, it'll probably take a week or so.
 
 Could anybody help me out here?
 
 All the best, thegermanguy

thegermanguy,

You can use this simple perl program to make your changes.

To use it, in Terminal do the following:
$ cat OLDFILE | perl slavish.pl  NEWFILE

This will make a copy of OLDFILE called NEWFILE with the changes you desire 
(while preserving the original).
This is a simple program, which could be optimized and have more error 
checking, yet it will do the job and 
is pretty straightforward to read.

You will need to modify it for your other conversion variations, this is marked 
and should be easy to follow.

Good Luck 

Matt

___
#!/usr/bin/perl

$index_line = q[MTypeName `Index'];

while ( $line =  ) {

if ( $line =~ m|$index_line| ) {
$change_line = ;
$change_line =~ s|MText `N\.: (.*)'|MText `N. $1; Nervus $1'|;
$change_line =~ s|MText `V\.: (.*)'|MText `V. $1; Vena $1'|;

### Add in the other variations here, remove the # at the beginning of 
the line
#   $change_line =~ s|MText `X\.: (.*)'|MText `X. \1; XRAY \1'|;
#   $change_line =~ s|MText `Y\.: (.*)'|MText `Y. \1; YANKEE \1'|;
#   $change_line =~ s|MText `Z\.: (.*)'|MText `Z. \1; ZULU \1'|;

print $line;
print $change_line;
} else {
print $line;
}
}

___

Test File:

I hava a huge file and need to change things repeatedly in the
following manner:
The lines I need to change ALWAYS follow a line saying
MTypeName `Index'
MText `N.: suprascapularis'
more stuff
MTypeName `Index'
MText `V.: supraorbital'
even more stuff
MTypeName `Index'
MText `N.: supernaut'
still more stuff

___


-- 
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: alert box doesn't open in bbedit preview?

2012-05-31 Thread David
Turns out I am half wrong on this issue. If I close the BBEDIT
previewer, then Ctrl+CMD P to run it again, the alert box pops up.
However, if I leave the Previewer open, make some changes to the
javascript code, then hit Ctrl+CMD P again, it does not pop up.

David.

On May 30, 9:43 pm, David dwarnol...@suddenlink.net wrote:
 All,

 I have this in my HTML file:

 script type=text/javascript
 alert('Hello, World!');
 /script

 However, when I preview this in BBEDIT, the alert box doesn't pop up
 (it does if I open the file in Safari). Should it pop up in the BBEDIT
 previewer, and if so, are there some preferences I have to set to get
 it to work?

 Thanks

 David

 BBEdit
 a product of Bare Bones Software, Inc.
 version 10.1.2 (3152)

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