Re: Auto-increase indent

2019-02-15 Thread Kendall Conrad
I wrote a script a while back to do this in at least a few helpful cases. I 
assign it to Cmd+Enter when I want it to activate. Useful C-style {} 
indents, Python indents, comment blocks, and numbered lists. The 
AppleScript can be adapted for any specific use case it doesn't fit. It's 
aware of your indentation settings as well so will know whether to use tabs 
or spaces and how many spaces.

http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/

Hope it's of use to you.

~AW


On Wednesday, February 13, 2019 at 7:55:17 AM UTC-5, Ehler wrote:
>
> I'm very new to using BBEdit but love a lot of things about it! I'm hoping 
> to mimic a feature from Sublime Text that increases the indent contextually 
> based on what you're doing with the code. Here's an example in JavaScript 
> (I don't claim to know anything)
>
> Here's what it looks like in Sublime Text 
> 
>
> Here's what it looks like in BBEdit doing the same things 
> 
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
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.
Visit this group at https://groups.google.com/group/bbedit.


Re: Can't assign certain key combinations to clippings

2017-10-24 Thread Kendall Conrad
With OS 10.11.6 and BBEdit 12.0.1 I was able to successfully assign 
Ctrl+Opt+Cmd+P (and C, T. S was already assigned) to a clipping and use it.

You may want to try and backup your settings/preferences somewhere and 
delete them to see if there's something funny with it as a way to narrow 
down the problem. I don't have Keyboard Maestro or KeyCue installed so 
can't say if they are a factor.

~Kendall

On Monday, October 23, 2017 at 2:12:25 PM UTC-4, Brian Gollands wrote:
>
> Using latest BBEdit and X.12 and I have had a number of clippings that I 
> use for adding HTML to text. I had assigned shortcuts to a lot of these and 
> in the last year sometime, some of them stopped working and I can't reset 
> them. Only certain combinations won't allow me to set them in the Clippings 
> palette (i.e., there is no response when I try to edit shortcuts and type 
> something into the field). I am running Keyboard Maestro, but have turned 
> it off, as well as checked for conflicting shortcut assignments. I also 
> went into Sys Prefs and removed any conflicting shortcuts in Keyboards > 
> Shortcuts. And KeyCue doesn't show any being used by the system. I also 
> logged in as a new user to avoid any accumulated "baggage" -- no joy.
>
> Some of the problem shortcuts are:
> ctl-opt-cmd-p
> ctl-opt-cmd-s
> ctl-opt-cmd-t
> ctl-opt-cmd-c
>
> These don't seem to be used BBEdit. Can anyone think of any other place 
> these might be assigned? Maybe an installed app uses those, but registers 
> them system-wide, even though it's not open? Again, nothing shows in 
> KeyCue. Any suggestions are most welcome. Thanks!
>
>

-- 
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: 
--- 
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.
Visit this group at https://groups.google.com/group/bbedit.


Re: changing HTML elements in certain unordered lists

2017-08-05 Thread Kendall Conrad
In the search string you list the end ul tag doesn't show the / () 
like you mention in the paragraph above it. Not sure if that was just a 
typo here or also in what you tried.

I don't think the regex approach is the best for this because it won't 
change all of them in one pass because of the multi-line matching. It would 
have to be run multiple times until it doesn't find a match.

My approach would be to open each file, highlight the entire ul from start 
to end and do a regex on the selection. If there are just too many files, 
then my second approach would be to use a Perl script that reads through 
the file until it finds the opening ul, then does li regex on each 
following line until it sees the end ul.

-Kendall


On Sunday, July 30, 2017 at 11:57:53 AM UTC-4, Dennis Chesters wrote:
>
> We have many HTML file with many special unordered lists  class="container"> and want to change the  elements in just those lists 
> to .  So, this involves finding the multi-line 
> block of text constituting the list, and replacing the  tags.
>
> I tried grepping a list into 5 chunks: 1) the  class="container"> string, 2) everything between the  and the next 
> plain , 3) the plain , 4) everything between the  and the 
> closing , 5) the closing . 
>
> So, the FIND string looks like: ( class="container">)((?s).*?)()((?s).*?)()
> The round-parentheses delimit the 5 chunks, the .*? is a non-greedy string 
> match, and the (?s) flag includes carriage returns in the dot-everything 
> search.
> The intended REPLACE string looks like: \1\2 class="vertical-divider">\4\5
> This brackets the new middle (3rd) chunk with the original 1st+second and 
> 4th+5th chunk.
>
> However, the FIND selects everything to the end-of-file after the  class="container">, despite the non-greedy (?s).*? syntax.
>
> How else to do this?
>
>

-- 
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: 
--- 
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.
Visit this group at https://groups.google.com/group/bbedit.


Re: how to continue the citation-mark on the next line after pressing enter

2016-01-23 Thread Kendall Conrad
Try setting the keyboard shortcut from within BBEdit and not using keyboard 
maestro. I don't use that program so not sure what side effects it could be 
causing. You can also try running the script from Script Editor. It may 
provide some output if it is hitting any errors. You can also add log 
messages in the script to see if values are being set correctly e.g., log 
"wleng = " & wleng

I'm using BBEdit 11.1.4.
It also works in TextWrangler 5.0.2.



On Saturday, January 23, 2016 at 10:36:33 AM UTC-5, Vlad Ghitulescu wrote:
>
> Hello again, 
>
>
> and sorry for being not clear enough! 
> I try to improve :-) below… 
>
> On 23 Jan 2016, at 16:01, Kendall Conrad wrote: 
>
> > I know the old script doesn't work and isn't suppose to for what you 
> > wanted, which is why I wrote the new one, which works very 
> > differently. 
>
> Yes, I understood this. 
> I thought initially that the new script will be an extended version of 
> the old one, that's why I expected that the old functions will continue 
> to work as usual. 
>
>
> > You didn't describe what happened with the new script so I can't say 
> > what 
> > happened. 
>
> With the new script the old KBM-trigger (CMD-Return) doesn't triggers 
> any visible change in the editor. 
>
> Please see the attached short screenrecord (ca. 26 seconds long and ca. 
> 3.8 MB big). 
> You'll see the old, disabled KBM-macro (for the Smart New Line) and the 
> new one (for Smart Quote), using the same trigger (CMD-Return) and doing 
> nothing (when you see that in the final the BBEdit-window doesn't change 
> at all I'm actually pressing CMD-Return repeatedly). 
>
>
> > You'll need to give more information and try messing with the 
> > script. Can't magically know what's wrong. 
>
> :-) 
> I realize this, sorry once again 
>
>
> > ~aw 
>
>
> Regards, 
> Vlad 
>
>
>
> > 
> > 
> > 
> > 
> > On Saturday, January 23, 2016 at 8:11:55 AM UTC-5, Vlad Ghitulescu 
> > wrote: 
> >> 
> >> Hello 
> >> 
> >> 
> >> and thanks for the quick reply **BUT** it doesn't work. 
> >> 
> >> I had this script of yours: 
> >> 
> >> -- 
> >> (* 
> >> Author: Kendall Conrad of Angelwatt.com 
> >> Name: Smart Newline 
> >> Created: 2010-01-23 
> >> Updated: 2012-04-21 
> >> Description: Based on the current line it will generate different 
> >> text for the context. It knows about indentation, code doc syntax, 
> >> function starts, lists, HTML li 
> >> *) 
> >> tell application "BBEdit" to tell front window 
> >> activate 
> >> set lineNum to startLine of selection 
> >> set leng to length of line lineNum 
> >> -- Move cursor to end of line 
> >> if leng > 0 then 
> >> select insertion point after (character (leng) of line 
> >> lineNum) 
> >> end if 
> >> 
> >> -- Find leading whitespace 
> >> set theResult to find "(^[\\s]*)" options {search mode:grep} 
> >> searching 
> >> in line (lineNum) 
> >> -- Set text to the white space found 
> >> set white to "" 
> >> if found of theResult then 
> >> set white to found text of theResult 
> >> end if 
> >> set wleng to length of white 
> >> 
> >> -- Define a tab based on user settings 
> >> set aTab to tab 
> >> if expand tabs then 
> >> set spaceTab to "" 
> >> repeat tab width times 
> >> set spaceTab to spaceTab & space 
> >> end repeat 
> >> set aTab to spaceTab 
> >> end if 
> >> 
> >> -- Are we starting a code doc? 
> >> if (leng - wleng) ≥ 3 then 
> >> if (characters (wleng + 1) through (wleng + 3) of line 
> >> lineNum as 
> >> string) is equal to "/**" then 
> >> set selection to return & white & " * " & return 
> >> & 
> >> white & " */" 
> >> select insertion point after line (lineNum + 1) 
> >> return 
> >> end if 
> >> end if 
> >> 
> >> -- Are we starting a code doc? 
> >> if (leng - wleng) ≥ 2 then 
> >> if (characters (wleng + 1) through (wleng + 2) of line 
> >>

Re: how to continue the citation-mark on the next line after pressing enter

2016-01-23 Thread Kendall Conrad
Yeah, I thought there may have been some weird white space issue. Glad that 
worked.

To get the extra space modified this following line near the end of the 
script.

set selection to return & white & _char

and add the extra space there like so,

set selection to return & white & _char & " "


~aw




On Saturday, January 23, 2016 at 2:14:07 PM UTC-5, Vlad Ghitulescu wrote:
>
> Hello! 
>
>
> On 23 Jan 2016, at 18:28, Kendall Conrad wrote: 
>
> > I don't see any obvious reason why it shouldn't be working. My example 
> > document looks like yours and I can't reproduce any errors. You might 
> > want 
> > to compare what you have with what I originally posted to make sure 
> > the 
> > script wasn't modified in any other ways while copying and pasting, 
> > especially the regular expression parts. 
>
> I've checked now with the version from Safari (browsing the 
> BBEdit-Talk-discussion) and it looks the same. 
> I've then put both versions in two separate BBEdit-text-files and made a 
> diff… and found a different tab-length. 
> So I copied once again the new script, this time from browser and… 
> boom! This time it works! 
>
> The only little error is that it doesn't put a space on the new line 
> after > (see the attachment). 
>
>
> Gruß, 
> Vlad 
>
>
>

-- 
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: how to continue the citation-mark on the next line after pressing enter

2016-01-23 Thread Kendall Conrad
I know the old script doesn't work and isn't suppose to for what you 
wanted, which is why I wrote the new one, which works very differently.

You didn't describe what happened with the new script so I can't say what 
happened. You'll need to give more information and try messing with the 
script. Can't magically know what's wrong.

~aw




On Saturday, January 23, 2016 at 8:11:55 AM UTC-5, Vlad Ghitulescu wrote:
>
> Hello 
>
>
> and thanks for the quick reply **BUT** it doesn't work. 
>
> I had this script of yours: 
>
> -- 
> (* 
>Author: Kendall Conrad of Angelwatt.com 
>Name: Smart Newline 
>Created: 2010-01-23 
>Updated: 2012-04-21 
>Description: Based on the current line it will generate different 
> text for the context. It knows about indentation, code doc syntax, 
> function starts, lists, HTML li 
> *) 
> tell application "BBEdit" to tell front window 
> activate 
> set lineNum to startLine of selection 
> set leng to length of line lineNum 
> -- Move cursor to end of line 
> if leng > 0 then 
> select insertion point after (character (leng) of line 
> lineNum) 
> end if 
>  
> -- Find leading whitespace 
> set theResult to find "(^[\\s]*)" options {search mode:grep} 
> searching 
> in line (lineNum) 
> -- Set text to the white space found 
> set white to "" 
> if found of theResult then 
> set white to found text of theResult 
> end if 
> set wleng to length of white 
>  
> -- Define a tab based on user settings 
> set aTab to tab 
> if expand tabs then 
> set spaceTab to "" 
> repeat tab width times 
> set spaceTab to spaceTab & space 
> end repeat 
> set aTab to spaceTab 
> end if 
>  
> -- Are we starting a code doc? 
> if (leng - wleng) ≥ 3 then 
> if (characters (wleng + 1) through (wleng + 3) of line 
> lineNum as 
> string) is equal to "/**" then 
> set selection to return & white & " * " & return & 
> white & " */" 
> select insertion point after line (lineNum + 1) 
> return 
> end if 
> end if 
>  
> -- Are we starting a code doc? 
> if (leng - wleng) ≥ 2 then 
> if (characters (wleng + 1) through (wleng + 2) of line 
> lineNum as 
> string) is equal to "/*" then 
> set selection to return & white & " * " & return & 
> white & " */" 
> select insertion point after line (lineNum + 1) 
> return 
> end if 
> end if 
>  
> -- Check for lists 
> set theResult to find "^\\s*[\\*#>\\+\\-]+([\\w ]*)" options 
> {search 
> mode:grep} searching in (line lineNum) 
> if found of theResult then 
> set preFind to find "[\\*#>\\+\\-]+" options {search 
> mode:grep} 
> searching in (line lineNum) 
> set _char to found text of preFind 
> set selection to return & white & _char & " " 
> select insertion point after line (lineNum + 1) 
> return 
> end if 
>  
> -- Check for numbered list: (1. goes to 2.), (2.5 goes to 2.6) 
> set theResult to find "^\\s*([\\d]+\\.)" options {search 
> mode:grep} 
> searching in (line lineNum) 
> if found of theResult then 
> set preNum to "" 
> set preNumResult to find "([\\d]+\\.)+\\d" options {search 
> mode:grep} 
> searching in (line lineNum) 
> if found of preNumResult then 
> set preNum to characters 1 thru -2 of (found text 
> of preNumResult) 
> end if 
> set numResult to find "[\\d]+\\. " options {search 
> mode:grep} 
> searching in (line lineNum) 
> if found of numResult then 
> set nextNum to ((characters 1 thru -3 of (found 
> text of numResult)) 
> as text) + 1 
> set selection to return & white & preNum & nextNum 
> & ". " 
> select insertion point after line (lineNum + 1) 

Re: how to continue the citation-mark on the next line after pressing enter

2016-01-23 Thread Kendall Conrad
Well, I can't read the exact error message since it's not English, but I 
believe I may see the problem. I think there's an extra line break after 
the word "searching". Make it so the next line is on the same line. That's 
the problem with posting code online, can't always control how it gets 
formatted. Later parts of the script had long lines as well so be sure they 
don't have extra new lines.



On Saturday, January 23, 2016 at 11:13:51 AM UTC-5, Vlad Ghitulescu wrote:
>
>
>
> On 23 Jan 2016, at 17:09, Kendall Conrad wrote: 
>
> > You can also try running the script from Script Editor. It may 
> > provide some output if it is hitting any errors. 
>
> I did and got promptly a syntax-error (see attachment). 
>
> I have a fresh installed El Capitan & BBEdit (version 11.1.4 (3780)).

-- 
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: how to continue the citation-mark on the next line after pressing enter

2016-01-23 Thread Kendall Conrad
I don't see any obvious reason why it shouldn't be working. My example 
document looks like yours and I can't reproduce any errors. You might want 
to compare what you have with what I originally posted to make sure the 
script wasn't modified in any other ways while copying and pasting, 
especially the regular expression parts.

The block of code that's commented with "-- Define a tab ..." is not being 
used in the script so you can remove it. There's 3 spots that use the 
"searching" piece and can't tell which one was causing the error. You can 
try placing log statements around each one to see when it hits an error.



On Saturday, January 23, 2016 at 11:52:14 AM UTC-5, Vlad Ghitulescu wrote:
>
> I've got them right now, compiled the script, saved it in BBEdit's 
> script-folder and started from there (with the cursor in line 3). I've 
> got another error saying: BBEdit got an error: Can’t get searching of 
> line 3 of window 1. (see also the attached screenshots) 
>
> On 23 Jan 2016, at 17:41, Kendall Conrad wrote: 
>
> > Well, I can't read the exact error message since it's not English, but 
> > I 
> > believe I may see the problem. I think there's an extra line break 
> > after 
> > the word "searching". Make it so the next line is on the same line. 
> > That's 
> > the problem with posting code online, can't always control how it gets 
> > formatted. Later parts of the script had long lines as well so be sure 
> > they 
> > don't have extra new lines. 
> > 
> > 
> > 
> > On Saturday, January 23, 2016 at 11:13:51 AM UTC-5, Vlad Ghitulescu 
> > wrote: 
> >> 
> >> 
> >> 
> >> On 23 Jan 2016, at 17:09, Kendall Conrad wrote: 
> >> 
> >>> You can also try running the script from Script Editor. It may 
> >>> provide some output if it is hitting any errors. 
> >> 
> >> I did and got promptly a syntax-error (see attachment). 
> >> 
> >> I have a fresh installed El Capitan & BBEdit (version 11.1.4 (3780)). 
> > 
> > -- 
> > This is the BBEdit Talk public discussion group. If you have a 
> > feature request or would like to report a problem, please email 
> > "sup...@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+un...@googlegroups.com . 
> > To post to this group, send email to bbe...@googlegroups.com 
> . 
>

-- 
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: how to continue the citation-mark on the next line after pressing enter

2016-01-22 Thread Kendall Conrad
What you wanted was a bit different than what Smart Newlines was for, but 
it was easy enough to create a modified version. I only did a small amount 
of testing, but seemed OK.

(*
Author: Kendall Conrad of Angelwatt.com
Name: Smart Prefixed Newline
Created: 2016-01-22
Updated: 2016-01-22
Description: Starts new line with the same line prefix as the current 
line and keeps the text
  from the current cursor position to the end of the line
*)
tell application "BBEdit" to tell front window
activate
set lineNum to startLine of selection
set leng to length of line lineNum
-- Find leading whitespace
set theResult to find "(^[\\s]*)" options {search mode:grep} searching 
in line (lineNum)
-- Set text to the white space found
set white to ""
if found of theResult then
set white to found text of theResult
end if
set wleng to length of white

-- Define a tab based on user settings
set aTab to tab
if expand tabs then
set spaceTab to ""
repeat tab width times
set spaceTab to spaceTab & space
end repeat
set aTab to spaceTab
end if

-- Check for list style lines
set theResult to find "^\\s*[\\*#>\\+\\-]+([\\w ]*)" options {search 
mode:grep} searching in (line lineNum)
if found of theResult then
set preFind to find "[\\*#>\\+\\-]+" options {search mode:grep} 
searching in (line lineNum)
set _char to found text of preFind
set selection to return & white & _char
select insertion point after selection
return
end if

-- Default: Insert a return plus the white space
set selection to return & white
select insertion point after selection
end tell


~aw




On Tuesday, January 19, 2016 at 8:58:34 AM UTC-5, Vlad Ghitulescu wrote:
>
> Hello! 
>
>
> While testing MailMate as an alternative to Apple's Mail.app I edit my 
> mails now in BBEdit. 
> That brings all the joy BBEdit makes :-)… and a question. 
>
> Replying to an email generates first text like this: 
>
> --- 
> > Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam 
> > nonumy eirmod 
> > tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
> --- 
>
> When I put the cursor let's say in the first line, between *(…) amet,* 
> and * consetetur (…)* and press ENTER, the cited text looks like this: 
>
> --- 
> > Lorem ipsum dolor sit amet, 
> consetetur sadipscing elitr, sed diam nonumy 
> > eirmod 
> > tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
> --- 
>
> instead of what I would like: 
>
> --- 
> > Lorem ipsum dolor sit amet, 
> > consetetur sadipscing elitr, sed diam nonumy 
> > eirmod 
> > tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
> --- 
>
> that is, the citation mark *> * is not continued. 
>
> I'm using already the Smart Newline - script 
> (http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/), 
>
> but it doesn't do it's magic here. 
>
> Do you have an idea, how could I convince the citation mark to *jump* on 
> the next line when inserting something in the middle of a line? 
>
> Thanks! 
>
>
> Regards, 
> Vlad 
>
>
>

-- 
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: global tab expansion

2014-11-28 Thread Kendall Conrad
There is an option under the Edit menu to Normalize Options. This makes the 
program forget the per document settings and applies the default (global) 
settings to the documents. It will do more than just the tab expansion 
though, just as a heads up. I believe this will get what you want though as 
long as the caveat doesn't bother you. The manual will have more details on 
it.

-kc


On Tuesday, November 25, 2014 7:26:12 PM UTC-5, Paul Colton wrote:

 I'm a little confused between the relationship of the global pref for tab 
 expansion versus the per document one. I set it on in the global prefs, but 
 most documents I open have it turned off in the per-document setting. I 
 just want it on 'period', regardless of what I am editing. How can I 
 accomplish that? Thanks.

 Paul



-- 
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: Emmet support

2014-11-06 Thread Kendall Conrad
Before it was Emmet, it was Zen Coding. I made some scripts a few years 
back that implemented a portion of the features for TextWrangler and 
BBEdit. I haven't tried it on newer versions of BBEdit, but it likely still 
works. I only use TextWrangler these days so can't try out the filter 
dialogs that Rich pointed to. Hopefully the scripts can help you out 
though, but I have no current intentions to update them.

http://www.angelwatt.com/coding/zen-coding_bbedit.php

-Kendall



On Monday, October 27, 2014 2:43:13 PM UTC-4, Dan Eveland wrote:

 Hi,

 Love BBedit. Been using for way too many years. Just upgraded to 11. I'll 
 mention now that BBedit is one of only half-a-dozen apps on my Mac that is 
 not from the app store, and is the only one in that category I don't mind 
 paying for upgrades on.

 Is there any way to get emmet functionality into BBedit? Is it already 
 there and I am just not seeing it? There is a nice plugin for TextMate, but 
 I am trying to focus on one singular text editor instead of having 4 
 installed all the time.

 Thanks!

 http://emmet.io


-- 
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: Clipboard Window

2013-02-27 Thread Kendall Conrad
According to the release notes, it was retired in v10.5.


On Wednesday, February 27, 2013 9:01:12 PM UTC-5, David Shea wrote:

 It's mentioned in the user manual - but I can't find it anywhere. 
 I can see previous/next clipboard in the edit window, but that's it. 

 I'm sure I'm missing something really obvious here 

 cheers, 

 David 


-- 
-- 
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: Grep help?

2013-02-21 Thread Kendall Conrad
I had to switch the \n to \r before that would work.

Nice approach to it.

-Kendall


On Thursday, February 21, 2013 12:49:46 AM UTC-5, Oliver Taylor wrote:

 On Feb 20, 2013, at 5:47 PM, Lorin Rivers lri...@mosasaur.comjavascript: 
 wrote:

 Oh Mighty Ones,

 I have a big list that looks something like this:
 speedo_705494_001.jpg
 speedo_7051210_418.jpg
 speedo_7051210_418_bk.jpg
 speedo_7051200_041.jpg
 speedo_7051200_041_bk.jpg
 speedo_7051200_041_bk_a.jpg
 speedo_7050911_173.jpg
 speedo_7050911_173_bk.jpg
 speedo_7050804_001.jpg
 speedo_7050804_001_bk.jpg
 speedo_705032_001.jpg
 speedo_705031_001.jpg

 and I want to make it like this:
 speedo_705494_001.jpg
 speedo_7051210_418.jpg,speedo_7051210_418_bk.jpg

 speedo_7051200_041.jpg,speedo_7051200_041_bk.jpg,speedo_7051200_041_bk_a.jpg
 speedo_7050911_173.jpg,speedo_7050911_173_bk.jpg
 speedo_7050804_001.jpg,speedo_7050804_001_bk.jpg
 speedo_705032_001.jpg
 speedo_705031_001.jpg


 My brain is dead and I can't figure it out.

 Anyone have a suggestion for a regex that will accomplish this?


 Search: *\n(.+bk(_a)?.jpg)+*
 Replace: *,\1*


-- 
-- 
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: Grep help?

2013-02-20 Thread Kendall Conrad
I couldn't see a way to get a 100% solution with just one grep run, but 
this works for items that have two, but not when there's three. If you run 
the same regex replace all multiple times it will accommodate more than two.

Find:
((\w+_\d+_\d+).*\.jpg)(\r(\2(.*\.jpg)))

Replace with:
\1,\4

-Kendall


On Wednesday, February 20, 2013 8:47:14 PM UTC-5, Lorin Rivers wrote:

 Oh Mighty Ones, 

 I have a big list that looks something like this: 
 speedo_705494_001.jpg 
 speedo_7051210_418.jpg 
 speedo_7051210_418_bk.jpg 
 speedo_7051200_041.jpg 
 speedo_7051200_041_bk.jpg 
 speedo_7051200_041_bk_a.jpg 
 speedo_7050911_173.jpg 
 speedo_7050911_173_bk.jpg 
 speedo_7050804_001.jpg 
 speedo_7050804_001_bk.jpg 
 speedo_705032_001.jpg 
 speedo_705031_001.jpg 

 and I want to make it like this: 
 speedo_705494_001.jpg 
 speedo_7051210_418.jpg,speedo_7051210_418_bk.jpg 
 speedo_7051200_041.jpg,speedo_7051200_041_bk.jpg,speedo_7051200_041_bk_a.jpg 

 speedo_7050911_173.jpg,speedo_7050911_173_bk.jpg 
 speedo_7050804_001.jpg,speedo_7050804_001_bk.jpg 
 speedo_705032_001.jpg 
 speedo_705031_001.jpg 


 My brain is dead and I can't figure it out. 

 Anyone have a suggestion for a regex that will accomplish this? 

 Thanks! 
 -- 
 Lorin Rivers 
 Mosasaur: Killer Technical Marketing http://www.mosasaur.com 
 mailto:lri...@mosasaur.com javascript: 
 512/203.3198 (m) 




-- 
-- 
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: Send selection to OmniFocus Applescript

2012-11-28 Thread Kendall Conrad
Using the of me part at the end is just something I've used to call 
functions in the same file that are outside of the tell application block 
that I'm currently in. I've not used the my keyword like you were using.

Doing a quick AppleScript keyword lookup 
(https://developer.apple.com/library/mac/#documentation/applescript/conceptual/applescriptlangguide/reference/ASLR_keywords.html)
 
shows the two are synonyms so it would have had the same effect.

-Kendall



On Wednesday, November 28, 2012 8:02:00 AM UTC-5, Jason Brown wrote:

 Well, I believe this was me saving the file in the wrong location. 
  I originally save the file in ~/Library/BBEdit/Scripts.  Not sure if I was 
 looking at old documentation or what.  After saving the script to 
 ~/Library/Application Support/BBEdit/Scripts it appears to work fine.

 Kendall, can you explain your comment in case I run into something else. 
  Thanks.

 On Tuesday, November 27, 2012 12:28:55 PM UTC-5, Jason Brown wrote:

 Someone was kind enough to put this script on git to send a selection from 
 BBEdit to OmniFocus.  The script works fine if I run it from Apple Script 
 Editor, but if I run it from BBEdit I get the following error message.

 A scripting error has occurred: script doesn't understand the makeOfTask 
 message.  Complete noob here so any advice is greatly appreciated.

 tell application BBEdit
  set _sel to the selection
  set _lines to lines in selection
  set tasks_added to {}
  repeat with _line in _lines
  if length of _line is not 0 then
  my makeOFTask(_line as text)
  set end of tasks_added to _line as text
  end if
  end repeat
  my growlNotify(tasks_added)
 end tell

 on makeOFTask(_text)
  tell application OmniFocus
  tell default document
  parse tasks with transport text _text
  end tell
  end tell
 end makeOFTask

 on growlNotify(tasks_added)
  set _count to length of tasks_added
  set AppleScript's text item delimiters to return
  set tasks_added to tasks_added as text
  set AppleScript's text item delimiters to 

  tell application System Events
  set growl_running to (count of (every process whose name is 
 Growl))  0
  end tell

  set subj to (_count as text)   Tasks Added
  set msg to tasks_added

  if growl_running then
  tell application Growl
  set the allNotificationsList to {Tasks Added}
  register as application OF-BBEdit all notifications 
 allNotificationsList default notifications allNotificationsList icon of 
 application OmniFocus

  notify with name Tasks Added title subj description 
 msg application name OF-BBEdit
  end tell
  end if

 end growlNotify



-- 
-- 
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: Send selection to OmniFocus Applescript

2012-11-27 Thread Kendall Conrad
Try calling the function like this,

makeOFTask(_line as text) of me



On Tuesday, November 27, 2012 12:28:55 PM UTC-5, Jason Brown wrote:

 Someone was kind enough to put this script on git to send a selection from 
 BBEdit to OmniFocus.  The script works fine if I run it from Apple Script 
 Editor, but if I run it from BBEdit I get the following error message.

 A scripting error has occurred: script doesn't understand the makeOfTask 
 message.  Complete noob here so any advice is greatly appreciated.

 tell application BBEdit
   set _sel to the selection
   set _lines to lines in selection
   set tasks_added to {}
   repeat with _line in _lines
   if length of _line is not 0 then
   my makeOFTask(_line as text)
   set end of tasks_added to _line as text
   end if
   end repeat
   my growlNotify(tasks_added)
 end tell

 on makeOFTask(_text)
   tell application OmniFocus
   tell default document
   parse tasks with transport text _text
   end tell
   end tell
 end makeOFTask

 on growlNotify(tasks_added)
   set _count to length of tasks_added
   set AppleScript's text item delimiters to return
   set tasks_added to tasks_added as text
   set AppleScript's text item delimiters to 

   tell application System Events
   set growl_running to (count of (every process whose name is 
 Growl))  0
   end tell

   set subj to (_count as text)   Tasks Added
   set msg to tasks_added

   if growl_running then
   tell application Growl
   set the allNotificationsList to {Tasks Added}
   register as application OF-BBEdit all notifications 
 allNotificationsList default notifications allNotificationsList icon of 
 application OmniFocus

   notify with name Tasks Added title subj description 
 msg application name OF-BBEdit
   end tell
   end if

 end growlNotify



-- 
-- 
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: A different kind of select word

2012-10-17 Thread Kendall Conrad
I've used something like this with a couple of my scripts.

if character 1 of found text of nextChar is in (characters 1 through -1 of 
 ,;'\) then

-Kendall


On Wednesday, October 17, 2012 6:17:22 PM UTC-4, Oliver Taylor wrote:

 I'm trying to write a different kind of Select Word script. I've used 
 Gruber's and several others, but find them lacking or buggy in lengthy 
 documents. Because I'm an applescript simpleton, and this is an interesting 
 exercise, I've done it with a chain of grep searches.

 The logic I'm using is this:
 1. Start by looking at the character to the right of the insertion point.
 2. If that character is a *space*, then move to the beginning of the word 
 (using customized regex),
 3. and then select to the end of the word (again, using a custom regex)
 4. *if not* reverse the order of the searches.

 This works very well for what I need, but I'd like to test for more than 
 just a space. Meaning: if the character to the right of the insertion point 
 is a space, or anything I define.

 Is it possible to test the found text *of* nextChar as regex?

 If you can point me in the right direction, I'd be grateful.

 *tell* *application* BBEdit


 --look at the next character
 *set* nextChar *to* *find* . searching in *text* *of* *front* *text 
 window* options {search mode:grep, wrap around:false}


 *if* found text *of* nextChar =   *then* --should also test for 
 punctuation
 -- search for the beginning of the word
 *find* ^|(?!\\w[^\\w\\s])\\b(?=\\w) searching in *text* *of* *front* *text 
 window* options {search mode:grep, wrap around:false, backwards:true} *
 with* selecting match
 -- then extend the selection to the end
 *find* (?=\\w)\\b(?![^\\w\\s]\\w)|$ searching in *text* *of* *front* *text 
 window* options {search mode:grep, wrap around:false, extend selection:
 true} *with* selecting match
 *else*
 -- search for the end of the word
 *find* (?=\\w)\\b(?![^\\w\\s]\\w)|$ searching in *text* *of* *front* *text 
 window* options {search mode:grep, wrap around:false} *with* selecting 
 match
 -- then extend the selection to the beginning
 *find* ^|(?!\\w[^\\w\\s])\\b(?=\\w) searching in *text* *of* *front* *text 
 window* options {search mode:grep, wrap around:false, backwards:true, extend 
 selection:true} *with* selecting match
 *end* *if*


 *end* *tell*


-- 
-- 
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 pattern for multi line /* ... */ blocks

2012-09-30 Thread Kendall Conrad
One indirect solution:
There's tools for compressing JavaScript files (minifiers). These strip 
comments and remove all unnecessary white space, which results in much 
smaller files. I use YUI Compressor for my JS and CSS files saving to 
-min.js file names. This might be the better approach in the long run if 
you're after getting smaller files. The comments can help later when 
reworking the code so it's good to keep them around for development.

Examples:
http://jscompress.com/
http://fmarcia.info/jsmin/test.html
http://www.crockford.com/javascript/jsmin.html
http://developer.yahoo.com/yui/compressor/

One direct solution:
Find: (?s)\/\*.*\*\/\r

The (?s) lets the . match newlines.

-Kendall

On Sunday, September 30, 2012 1:55:26 PM UTC-4, kt wrote:

 Hi

 I've been futzing around with grep for nearly an hour and can't figure out 
 how to grep multi-line /* ... */ blocks. I have a large Javascript source 
 file with tons of single and multi line comments and I want to strip them 
 all out to reduce file size. I got the single line grep working 
 (\r//[^\r]+) but I'm stumped on the multi line version. Anyone help me out?

 Thanks in advance

 Ken


-- 
-- 
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: tab-completion

2012-09-29 Thread Kendall Conrad
(Sorry if this posted twice)

Not sure if Matt is still around, but I continued working on the script I 
started and got it working pretty well. It works for both relative and 
absolute file paths. When multiple matches are found, it will display them 
in a numbered list and allow you to pick one to put into the document.

I've placed the script on my site for improved visibility. Hope it's useful 
for someone. I had fun getting it to work even though I don't really need 
it.

http://www.angelwatt.com/coding/bbedit-autocomplete-filename.php

-Kendall

On Wednesday, September 26, 2012 11:46:32 PM UTC-4, Kendall Conrad wrote:

 There's nothing builtin for that kind of functionality and is much easier 
 said than done. I did write up an AppleScript that works decently well from 
 my mild testing. There's a bit that could be cleaned up from it and likely 
 simplified. If someone wants to improve upon go ahead.

 Essentially, it tries determine any file path in front of the text cursor 
 (e.g., ../images/tes), then splits it out into directory and partial file 
 name. It also has to find out what directory the currently edited file 
 exists. Parsing out all of this it builds a command in the form of,

 ls -A1 relative directory | grep partialFileName

 If one result comes back, it replaces the partial file name with it. If 
 more than one is found it displays a message that more than one match was 
 found. If a file path couldn't be found it doesn't do anything. This works 
 for the current directory as well, whether you give ./ or just the start of 
 the name.

 Just copy and paste the script below into AppleScript Editor and save it 
 the BBEdit's script folder. Then you can assign a keyboard shortcut to it 
 if you want quick access. Again, the code it a little dirty and not well 
 tested, but seems to work OK, just don't try and trick it.

 
 tell application BBEdit
 activate
 set lineNum to startLine of selection
 set aaa to (characterOffset of line (startLine of selection)) of front 
 window
 set zzz to (characterOffset of selection)
 set cursorPos to zzz - aaa
 set linestr to characters 1 thru cursorPos of line lineNum of front 
 window
 
 set theResult to find ([\\w\\.\\-\\/_]+) options {search mode:grep, 
 backwards:true} searching in linestr
 set startstr to 
 if found of theResult then
 set startstr to found text of theResult
 end if
 
 set pre to 
 set partial to startstr
 
 if startstr contains / then
 set delim to AppleScript's text item delimiters
 set AppleScript's text item delimiters to /
 set partial to last text item of startstr
 set idx to 1
 repeat (count text item of startstr) - 1 times
 if idx  1 then set pre to pre  /
 set pre to pre  text item idx of startstr
 set idx to idx + 1
 end repeat
 set AppleScript's text item delimiters to delim
 end if
 -- no partial filename, give up
 if partial =  then return
 
 -- find pwd of document
 set fp to (POSIX path of (file of front window as string))
 set fpchars to characters of fp
 set fprev to reverse of fpchars
 set fpdir to characters 1 thru ((length of fp) - (offset of / in 
 (fprev as string))) of fp
 
 set cmd to cd   (quoted form of (fpdir as string))  ; ls -A1   
 pre   | grep \  partial  \
 --display dialog cmd
 set cmdR to 
 try
 set cmdR to do shell script cmd
 on error theErr
 display dialog theErr
 return
 end try
 
 if cmdR contains return then
 -- More than one file/folder matches
 display dialog Multiple matches
 return
 end if
 
 set startPartial to cursorPos - (length of partial) + 1
 set characters startPartial thru cursorPos of line lineNum of front 
 window to cmdR
 
 end tell
 

 -Kendall

 On Wednesday, September 26, 2012 10:26:35 AM UTC-4, Matt Karikomi wrote:

 hi all this is my first post in the group.  im just using bbedit for the 
 first time and love it.  i didnt get anything obvious in a search so here 
 goes.  id like to implement tab-completion for relative urls.  like if 
 there was an attribute url(../images/a..) and id like to just hit the tab 
 key to get  url(../images/armored_flamingos.jpg) 

 thanks in advance!



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

Re: tab-completion

2012-09-26 Thread Kendall Conrad
There's nothing builtin for that kind of functionality and is much easier 
said than done. I did write up an AppleScript that works decently well from 
my mild testing. There's a bit that could be cleaned up from it and likely 
simplified. If someone wants to improve upon go ahead.

Essentially, it tries determine any file path in front of the text cursor 
(e.g., ../images/tes), then splits it out into directory and partial file 
name. It also has to find out what directory the currently edited file 
exists. Parsing out all of this it builds a command in the form of,

ls -A1 relative directory | grep partialFileName

If one result comes back, it replaces the partial file name with it. If 
more than one is found it displays a message that more than one match was 
found. If a file path couldn't be found it doesn't do anything. This works 
for the current directory as well, whether you give ./ or just the start of 
the name.

Just copy and paste the script below into AppleScript Editor and save it 
the BBEdit's script folder. Then you can assign a keyboard shortcut to it 
if you want quick access. Again, the code it a little dirty and not well 
tested, but seems to work OK, just don't try and trick it.


tell application BBEdit
activate
set lineNum to startLine of selection
set aaa to (characterOffset of line (startLine of selection)) of front 
window
set zzz to (characterOffset of selection)
set cursorPos to zzz - aaa
set linestr to characters 1 thru cursorPos of line lineNum of front 
window

set theResult to find ([\\w\\.\\-\\/_]+) options {search mode:grep, 
backwards:true} searching in linestr
set startstr to 
if found of theResult then
set startstr to found text of theResult
end if

set pre to 
set partial to startstr

if startstr contains / then
set delim to AppleScript's text item delimiters
set AppleScript's text item delimiters to /
set partial to last text item of startstr
set idx to 1
repeat (count text item of startstr) - 1 times
if idx  1 then set pre to pre  /
set pre to pre  text item idx of startstr
set idx to idx + 1
end repeat
set AppleScript's text item delimiters to delim
end if
-- no partial filename, give up
if partial =  then return

-- find pwd of document
set fp to (POSIX path of (file of front window as string))
set fpchars to characters of fp
set fprev to reverse of fpchars
set fpdir to characters 1 thru ((length of fp) - (offset of / in 
(fprev as string))) of fp

set cmd to cd   (quoted form of (fpdir as string))  ; ls -A1   
pre   | grep \  partial  \
--display dialog cmd
set cmdR to 
try
set cmdR to do shell script cmd
on error theErr
display dialog theErr
return
end try

if cmdR contains return then
-- More than one file/folder matches
display dialog Multiple matches
return
end if

set startPartial to cursorPos - (length of partial) + 1
set characters startPartial thru cursorPos of line lineNum of front 
window to cmdR

end tell


-Kendall

On Wednesday, September 26, 2012 10:26:35 AM UTC-4, Matt Karikomi wrote:

 hi all this is my first post in the group.  im just using bbedit for the 
 first time and love it.  i didnt get anything obvious in a search so here 
 goes.  id like to implement tab-completion for relative urls.  like if 
 there was an attribute url(../images/a..) and id like to just hit the tab 
 key to get  url(../images/armored_flamingos.jpg) 

 thanks in advance!


-- 
-- 
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: Applescripting Search/Replace Strings Question

2012-09-24 Thread Kendall Conrad
The script seemed to work for me. When I add the line display dialog SS  
 /   RS it shows the correct values for me.

-Kendall


On Sunday, September 23, 2012 9:53:57 PM UTC-4, Christopher Stone wrote:

 Hey Folks,

 This is simple:

 tell *application* BBEdit
 set {search string:SS, replacement string:RS} to (current search strings)
 end tell

 But I can't seem to access 'replace string script' or 'search string 
 script'.

 search string properties

 What am I missing?

 Thanks.

 --
 Best Regards,
 Chris



-- 
-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to 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: Sequential numbering

2012-09-04 Thread Kendall Conrad
Looks cool. I'm less familiar with the idiomatic parts. I generally try to 
write it more readable so there's a chance a year later that I'll still 
know what the code does. I don't use Perl much so the syntax is always 
foggy.

The /e flag was new to me, but very helpful. I was trying something like 
that without it, but unsuccessful. I hadn't used the qr// technique before 
either so I learned some new tricks. Thanks for sharing this shortened 
version.

-Kendall


On Tuesday, September 4, 2012 11:36:44 AM UTC-4, Ronald J Kimball wrote:

 On Mon, Sep 03, 2012 at 08:56:13AM -0700, Kendall Conrad wrote: 
  #!/usr/bin/perl 
  my $str = '\bthe\b'; 
  my $iter = 0; 
  while () { 
  if ($_ =~ m/${str}/){ 
  my $n1 = $_; 
  while ($n1 =~ m/(${str})/) { 
  $iter++; 
  $n1 =~ s/(${str})/$1${iter}/; 
  } 
  print $n1; 
  } 
  else { 
  print $_; 
  } 
  } 

 I hope Kendall won't mind if I suggest a version using more idiomatic 
 Perl: 

 #!perl 

 my $re = qr/\bthe\b/; 
 my $iter = 0; 
 while () { 
   s/($re)/ $1 . ++$iter /ge; 
   print; 
 } 

 Ronald 


-- 
-- 
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: Sequential numbering

2012-09-03 Thread Kendall Conrad
Here's a Perl script that can work as a Unix Filter. It replaces all 
instances of 'the' with 'the#' where # goes from 1 to number of 
occurrences. You just have to replace the $str variable at the top with a 
regex you want to find and alter. Below is sample before and after effect 
of the script.

Sample before:
some text the example for the place.
some text theatre example for th place.
some text the example for the place.

Sample after:
some text the1 example for the2 place.
some text theatre example for th place.
some text the3 example for the4 place.

---
#!/usr/bin/perl
my $str = '\bthe\b';
my $iter = 0;
while () {
if ($_ =~ m/${str}/){
my $n1 = $_;
while ($n1 =~ m/(${str})/) {
$iter++;
$n1 =~ s/(${str})/$1${iter}/;
}
print $n1;
}
else {
print $_;
}
}
---


-Kendall


On Monday, September 3, 2012 2:42:36 AM UTC-4, AB wrote:

 Can anyone help with a script or text filter to add a number after a 
 string in a file, starting at 1 at the first occurrence from the top of the 
 file and incrementing by one at each subsequent occurrence ? The string is 
 appel but could anything.

 I have tried to adapt scripts found here, but all I have managed to do so 
 far is to sequentially number every character in a file...

 Thanks !

 AB


-- 
-- 
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 with Regular Expression to convert internal links

2012-08-26 Thread Kendall Conrad
Using just grep alone I don't see a way to fully do this. The closest I 
could come up with is:

find: \[ ([^\]]+)\]\[\]
Replace: [ \1](#\L\1)

This will turn
[ Charging for School Activities][]
into
[ Charging for School Activities](#charging for school activities)

This still leaves the spaces that need translating into dashes in anchor 
portion. If you're not afraid of using Perl, you can use a unix filter.

---
#!/usr/bin/perl
while () {
if ($_ =~ m/\[ ([^\]]+)\]\[\](.*)$/) {
($n2=$1) =~ tr/A-Z /a-z\-/;
print [ $1](#$n2)$2\n;
}
else {
print $_;
}
}
---
You can run this from the #! menu.

-Kendall



On Sunday, August 26, 2012 11:36:05 AM UTC-4, psilas wrote:

 Hello, 

 I would like to convert Multimarkdown internal links to Pandoc ones, 
 and from reading my BBEdit manual it seems like it would be easiest to 
 use grep to accomplish this (that is if someone can help me with the 
 regular expression I would need). 

 Multimarkdown handles internal links like so: 

 [ Charging for School Activities][] 

 and I use these in my table of contents to link to the Header 
 Charging for School Activities. 

 to do the same thing in I would to write 

 [ Charging for School Activities](#charging-for-school-activites) 

 After looking at how to use grep I realised I could spend a long time 
 trying to get this right.  I have a long table of contents in a number 
 of documents. 

 Can anyone help please? 

 Thanks in advance. 

 Simon. 


-- 
-- 
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, Preview PHP

2012-08-04 Thread Kendall Conrad
For PHP previews I believe you just need to setup the site in the 
preferences. I'm still on BBEdit 9 so can't tell you exactly where the 
setting is, but it shouldn't be hard to find. I don't generally use the 
preview for PHP files so I can't say 100% if this will work, but pretty 
sure I've seen others discuss it on this group list.

-Kendall


On Saturday, August 4, 2012 5:56:11 PM UTC-4, Marin Knezović wrote:

 Greetings,

 I'm new to BBEdit, using it just for a day, and BBEdit-s autocomplete blow 
 my mind. Best autocompletion from any editor I've tried. Using PHP + 
 CodeIgniter and it works like a charm. But since I'm new to editor, I have 
 some really silly problems, so I was hoping to get some help in this 
 group :)

 When I go to Markup - Preview in BBEdit, previewing PHP files doesn't 
 work. It only shows my PHP code. Any chance I can set localhost so I can 
 actually preview my PHP?
 In preferences I don't see any settings for localhost or similar.

 And a nother question... BBEdit schemes. Downloaded a few, and some simply 
 don't work. After googling about this issue, I found that some work just 
 for HTML or CSS, etc. I wanted to use monokai scheme for PHP, found one, 
 but it can't be used for PHP files. Any tutorial on making schemes so I can 
 adjust Monokai for PHP as well?:)

 Thank you for reply(ies) in advance,
 Marin Knezovic :)


-- 
-- 
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 pattern - help needed

2012-07-24 Thread Kendall Conrad
Try this

^\d+ \w+ '([\d:]+)' \w+ '\1'$

The .+ you have might be matching more than you wanted. Also the \0 matches 
all of the match. You can use \0 through \9.

-KC



On Tuesday, July 24, 2012 7:42:55 AM UTC-4, Melissa wrote:

 I'm hoping someone can help me work this one out. I have text in this 
 format:

 1 Replaced  '1:2:333:4' with '1:2:333:4'
 12 Replaced  '1:2:444:10' with '1:2:444:7'
 105 Replaced  '1:2' with '1:3'
 200 Replaced  '1:2:7' with '1:2:70:9'

 What I want to do is find all the lines where the set of numbers between 
 the quotes match, like in the first line. I was hoping that something like 
 this would work:

 ^\d+ Replaced '(.+)' with '\01'$

 ...but it doesn't. Can someone point me in the right direction please?

 Thanks!
 Melissa


-- 
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 remove white space between every other line?

2012-06-27 Thread Kendall Conrad
The following grep find/replace seems to work.

^(.+)\r(.+)$
\1,\2



On Wednesday, June 27, 2012 5:53:00 PM UTC-4, lumaflux wrote:

 I have documents that I need to remove the white space between the first 
 and second line and add a comma. For example before:

1. ¿Qué vas a comprar?
2. What are you going to buy?
3. Nosotros vamos a ir a la tienda.
4. We are going to go to the store.
5. ¿Puedes ir conmigo?
6. Can you go with me?


 After:

1. ¿Qué vas a comprar?,What are you going to buy?
2. Nosotros vamos a ir a la tienda.,We are going to go to the store.
3. ¿Puedes ir conmigo?,Can you go with me?

 What would be the best way to do this in BBedit (Applescript)? 
 I'm sure it's simple, but I can't get a hold on 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: Simple ROT13

2012-06-23 Thread Kendall Conrad
I found a rot13 Python script in my BBEdit Unix Filter folder. Below is the 
script. As a Unix Filter, it will be applied to whatever is highlighted, or 
the entire file if there's no selection. I don't remember where the script 
came from, but seems to work. Alternatively, you could write your own Unix 
Filter that goes to a Bash script using the command you gave, though not 
quite in it's current format, provided after the Python.

=
#!/usr/local/bin/python

import fileinput
import string

unshifted = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
shifted =   'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM'
rot13_table = string.maketrans(unshifted, shifted)

for my_line in fileinput.input():
print string.translate(my_line, rot13_table),

=

#!/bin/sh
cat $1 | tr a-zA-Z n-za-mN-ZA-M

=

-Kendall


On Saturday, June 23, 2012 5:58:55 PM UTC-4, LuKreme wrote:

 I know there is an old plugin for BBEfit that does ROT13, but considering 
 it's 6 years old I have no idea if it even works with a modern mac and a 
 modern version of BBEdit.

 However, it seems pretty straightforward to do, maybe with a text factory?

 cat text | tr a-zA-Z n-za-mN-ZA-M

 But I'd prefer not dropping to the command line to do this.

 (Yes, I know, ROT13 is a relic of a bygone age, but it is still sometimes 
 useful1 on USENET, or at least requested.)

 1 FSVO useful.

 -- 
 I just got into the Beatles a couple years ago, you know, I like it. 
 —Ziggy Marley



-- 
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: Move to beginning of line after whitespace

2012-06-03 Thread Kendall Conrad
I wrote a script a while back based on discussions here that do this, 
though I'm not sure about the behavior you mention about lists. That part 
wasn't clear to me, though I might have an idea. The script goes to the 
first non-whitespace character on first execution. If done a second time 
(or you're already at the first non-white) then it will go to the true 
first position.

http://www.angelwatt.com/words/2010/07/31/bbedit-textwrangler-home-key-behavior/

-Kendall

On Sunday, June 3, 2012 2:46:55 PM UTC-4, Oliver Taylor wrote:

 I'm trying to write an applescript that emulates vim's go to first 
 non-whitespace character on the line.

 I'm also building it to be smart about skipping lists (since most of my 
 writing is prose).

 The problem is that it seems like the find operation triggers before the 
 keystroke. Is there a simple way to tell BBEdit to do one at a time and 
 wait for the previous to finish before triggering the next?

 *tell* *application* BBEdit

 *tell* *application* System Events

 *keystroke* a using control down

 *end* *tell*

 *try*

 *find* ([^ \\t\\*\\-\\•\\d\\.]) searching in *text* *of* *front* *text 
 window* options {search mode:grep, starting at top:false, wrap around:
 false, backwards:false, case sensitive:false, match words:false, extend 
 selection:false} *with* selecting match

 *end* *try*

 *end* *tell*

 *
 *

 Thanks!


-- 
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: Delete to end of document script

2012-05-23 Thread Kendall Conrad
When you're doing the set to  toward the end, you have it go from start 
through (start + end), which goes beyond the end of the document, which 
will cause an error. Try this for those 3 lines:

set theStart to selection's characterOffset
set theEnd to characterOffset of last character of text 1 of text 
document 1
set (characters theStart thru theEnd of text document 1) to 


-Kendall


On Wednesday, May 23, 2012 4:33:42 PM UTC-4, Lalock wrote:

 It seems like this should be easy, but everything I've tried has 
 failed. I'm trying to do a find and replace, then delete from a given 
 text point down to the end of the document. Here's my latest effort: 

 tell application BBEdit 
 activate 
 open test.txt 
 replace °° using  
  searching in text 1 of text window 1 options {search mode:literal, 
 starting at top:true, wrap around:false, backwards:false, case 
 sensitive:false, match words:false, extend selection:false} 

 tell text 1 of text document 1 
 set find_results to find  
 @rule: options {search mode:grep, starting at top:false, wrap 
 around:true, backwards:false, case sensitive:false, match words:false, 
 extend selection:false} 
 set theStart to selection's characterOffset 
 set theEnd to last character of text 1 of text document 1 
 set (characters theStart thru (theStart + theEnd)) to  
 end tell 

 save window 1 
 close window 1 
 end tell 

 Can anyone tell me what I'm doing wrong? The error I get highlights 
 last character and gives the message: BBEdit got an error: An 
 attempt was made to resolve an Apple Event reference to a non-existent 
 object (MacOS Error code: -1728)

-- 
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: Find string 1. Find string 2. Replace 2 with 1. ?

2012-05-22 Thread Kendall Conrad
I believe the following find/replace should work. I took your description 
to mean that the contents inside h1 should be replaced with the contents of 
the title1 tag and vice versa. This achieved that in brief testing.

Search for:
(?s)(title1)(.+?)/\1(.+?)h1(.+?)/h1

Replace with:
\1\4/\1\3h1\2/h1

The (?s) allows the . to match across new lines.

-Kendall


On Tuesday, May 22, 2012 5:49:06 PM UTC-4, Be wrote:

 Is this even possible using Grep?

 I have a variable string towards the top of each document that looks like:

 title1Variable string with unknown number of words, digits, spaces and 
 returns/title1

 I have another variable string a little further down in each document that 
 looks like:

 h1Variable string with same unknowns as the first variable string/h1

 I want to replace the 2nd string with the first string.

 Any ideas would be appreciated. Thanks!




-- 
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: about a regex pattern

2012-04-02 Thread Kendall Conrad
Simply put, it's trying to find a fit. If .* matched to the end, then the 
pattern after .* wouldn't match, thus it wouldn't be matching anything. 
Regex don't work just left to right matching whatever they can as they go. 
They look forward and backward to find an appropriate match. Since the 
regex contains the $ for the end, it works from there backwards to match as 
well.

-Kendall


On Monday, April 2, 2012 7:50:39 AM UTC-4, Ptarmigan wrote:

 $pattern =/(^.*?sheet\/)pub(.*)(\[a-z\=]*$)/;


 I arrived at the above pattern to parse a published gdoc spreadsheet url: 
 example -


 https://spreadsheets.google.com/spreadsheet/pub?hl=en_GBhl=en_GBkey=0BcCVZg3fefASrFG1P7HxN1Mnb241cFNKS0dVUNjUO5coutput=html
 


 The part of the pattern after 'pub' is the bit which puzzles me. The first 
 set of parentheses after 'pub' can contain anything. So why doesn't it grab 
 everything up to the end of the line ?

 It seems to be halted in a non-greedy way by the last parentheses which 
 defines a string connected to the EOL and stretching back to the first 
 encountered ampersand. 

 Why this works, I do not know. I'm glad it does. Does anyone know why i.e 
 why the (.*) after 'pub' doesn't overrule the (\[a-z\=]*$) ?

 tom



-- 
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 Next List Item

2012-03-28 Thread Kendall Conrad
For anyone that was waiting, I did update the script to include handling of 
+ listed items. I also added . I made some other enhancements too while I 
was at it. The numerical listing handles both going 3. to 4., but also 2.4. 
to 2.5. so it handles decimal numbering or sub sections. Lastly, I added 
HTML list item support; it creates a li tags, copies the li tag's 
attributes from the current line, and duplicates them and also places the 
cursor inside the tag.

If you have visited the page before you'll likely need to hit refresh to 
ensure you're seeing the latest page updates. I haven't had a chance to do 
thorough testing so if you see issues or have other suggestions let me know.

http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/

-Kendall

On Tuesday, March 27, 2012 9:50:05 AM UTC-4, Kendall Conrad wrote:

 The link I provided does have the latest code. If you visited the page 
 somewhat recently you may need to do a refresh to see the latest changes. 
 The code will state that is was last updated March 26 at the top of the 
 code listing.

 The updated code does handle doing lists that start with *, #, and -, but 
 not +. I thought about it, but couldn't think of anytime I've seen it used. 
 It would be very easy to add though to the code. Just edit the section 
 Check for lists and add \\+ to the two regex finds. It has to be escaped 
 since it's a special character for regex. I'll make an update when I get a 
 chance, probably within the next 20 hours.

 -Kendall

 On Tuesday, March 27, 2012 2:18:19 AM UTC-4, KG wrote:

 @Kendall : just one more thing, can you provide a link to the latest 
 source. from the url you provided i don't see the numbered list edit that 
 you said you made

 Thanks

 On Tuesday, March 27, 2012 5:14:31 AM UTC+3, Kendall Conrad wrote:

 My Smart Newline script can achieve this. You can examine the code 
 near the top to see how I capture to white space at the start of the 
 line if that's all you care about. I also updated the script this 
 evening to also handle numbered lists, which was part of the original 
 discussion question, though this is a little late for that I suppose, 
 but others might find it useful. 

 http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/ 

 -Kendall 

 On Mar 26, 4:45 pm, KG for...@kaush.co wrote: 
  Hey Christopher, 
  
  Just a minor request to your existing script. This works fantastically 
 if 
  you line starts with the bullet. Assuming you have some indentation 
 like 4 
  tab stops and then the bullet, the script stops. I made a couple of 
 mods to 
  the script as follows: 
  
  
 ---
  

  tell application BBEdit 
  try 
  tell text of front text window 
  set lineOfInsertionPoint to line (startLine of 
 selection) 
  set findReco to find ^\\d+\\. searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set leadingNumber to text 1 thru -2 of (found text 
 of 
  findReco) 
  set text of selection to return  (leadingNumber + 
 1)  
  .  
  select insertion point after selection 
  else if found of findReco = false then 
  set findReco to find ^\\*  searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set text of selection to return  *  
  select insertion point after selection 
  else 
  set findReco to find ^\\s*\\+ searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  
  set text of selection to return  tab  + 
  
  select insertion point after selection 
  end if 
  end if 
  end if 
  end tell 
  on error errMsg number errNum 
  set sep to == 
  set e to sep  return  Error:   errMsg  return  sep 
  
  return ¬ 
   Error Number:   errNum  return  sep 
  beep 
  display dialog e 
  end try 
  end tell 
  
 ---
  

  
  Essentially the \s* helps ignore white space at the beginning. There's 
 just 
  one problem with my script. It inserts the new bullet point ignoring 
 the 
  previous number of tab stops. Is there a way in applescript to get 
 hold of 
  the number of tab stops and insert that at the beginning as well? 
  
  Thanks again. 
  
  
  
  
  
  
  
  On Monday, August 8, 2011 7:04:04 AM UTC+3, Christopher Stone wrote: 
  
   On Aug 07

Re: Insert Next List Item

2012-03-27 Thread Kendall Conrad
The link I provided does have the latest code. If you visited the page 
somewhat recently you may need to do a refresh to see the latest changes. 
The code will state that is was last updated March 26 at the top of the 
code listing.

The updated code does handle doing lists that start with *, #, and -, but 
not +. I thought about it, but couldn't think of anytime I've seen it used. 
It would be very easy to add though to the code. Just edit the section 
Check for lists and add \\+ to the two regex finds. It has to be escaped 
since it's a special character for regex. I'll make an update when I get a 
chance, probably within the next 20 hours.

-Kendall

On Tuesday, March 27, 2012 2:18:19 AM UTC-4, KG wrote:

 @Kendall : just one more thing, can you provide a link to the latest 
 source. from the url you provided i don't see the numbered list edit that 
 you said you made

 Thanks

 On Tuesday, March 27, 2012 5:14:31 AM UTC+3, Kendall Conrad wrote:

 My Smart Newline script can achieve this. You can examine the code 
 near the top to see how I capture to white space at the start of the 
 line if that's all you care about. I also updated the script this 
 evening to also handle numbered lists, which was part of the original 
 discussion question, though this is a little late for that I suppose, 
 but others might find it useful. 

 http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/ 

 -Kendall 

 On Mar 26, 4:45 pm, KG for...@kaush.co wrote: 
  Hey Christopher, 
  
  Just a minor request to your existing script. This works fantastically 
 if 
  you line starts with the bullet. Assuming you have some indentation 
 like 4 
  tab stops and then the bullet, the script stops. I made a couple of 
 mods to 
  the script as follows: 
  
  
 ---
  

  tell application BBEdit 
  try 
  tell text of front text window 
  set lineOfInsertionPoint to line (startLine of 
 selection) 
  set findReco to find ^\\d+\\. searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set leadingNumber to text 1 thru -2 of (found text 
 of 
  findReco) 
  set text of selection to return  (leadingNumber + 
 1)  
  .  
  select insertion point after selection 
  else if found of findReco = false then 
  set findReco to find ^\\*  searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  set text of selection to return  *  
  select insertion point after selection 
  else 
  set findReco to find ^\\s*\\+ searching in 
  lineOfInsertionPoint options {search mode:grep} 
  if found of findReco = true then 
  
  set text of selection to return  tab  + 
  
  select insertion point after selection 
  end if 
  end if 
  end if 
  end tell 
  on error errMsg number errNum 
  set sep to == 
  set e to sep  return  Error:   errMsg  return  sep  
  return ¬ 
   Error Number:   errNum  return  sep 
  beep 
  display dialog e 
  end try 
  end tell 
  
 ---
  

  
  Essentially the \s* helps ignore white space at the beginning. There's 
 just 
  one problem with my script. It inserts the new bullet point ignoring 
 the 
  previous number of tab stops. Is there a way in applescript to get hold 
 of 
  the number of tab stops and insert that at the beginning as well? 
  
  Thanks again. 
  
  
  
  
  
  
  
  On Monday, August 8, 2011 7:04:04 AM UTC+3, Christopher Stone wrote: 
  
   On Aug 07, 2011, at 21:35, oliver wrote: 
  
   I'm thinking it might have to be an AppleScript to select the line 
 and 
   then call a Text Filter to handle finding the number/star and 
 appending the 
   next one... but my kung fu is not strong enough to figure it out. 
  
   
 __ 
  
   Hey Oliver, 
  
   This is very quick and dirty, but it'll work with the numerical 
 increment 
   and the asterisk bullet. 
  
   It's expecting the insertion point (cursor) to be at the end of the 
 line, 
   but it could easily be adjusted so that anywhere in the line would 
 do. 
  
   You can put it in the script menu and give it a keyboard shortcut and 
 go 
   to town. 
  
   The logic is pretty straightforward, so you can add more characters 
 like 
   '•' to the mix if desired. 
  
   -- 
   Best

Re: Insert Next List Item

2012-03-26 Thread Kendall Conrad
My Smart Newline script can achieve this. You can examine the code
near the top to see how I capture to white space at the start of the
line if that's all you care about. I also updated the script this
evening to also handle numbered lists, which was part of the original
discussion question, though this is a little late for that I suppose,
but others might find it useful.

http://www.angelwatt.com/words/2011/04/11/bbedit-smart-newline-open-line/

-Kendall

On Mar 26, 4:45 pm, KG for...@kaush.co wrote:
 Hey Christopher,

 Just a minor request to your existing script. This works fantastically if
 you line starts with the bullet. Assuming you have some indentation like 4
 tab stops and then the bullet, the script stops. I made a couple of mods to
 the script as follows:

 ---
     tell application BBEdit
         try
             tell text of front text window
                 set lineOfInsertionPoint to line (startLine of selection)
                 set findReco to find ^\\d+\\. searching in
 lineOfInsertionPoint options {search mode:grep}
                 if found of findReco = true then
                     set leadingNumber to text 1 thru -2 of (found text of
 findReco)
                     set text of selection to return  (leadingNumber + 1) 
 . 
                     select insertion point after selection
                 else if found of findReco = false then
                     set findReco to find ^\\*  searching in
 lineOfInsertionPoint options {search mode:grep}
                     if found of findReco = true then
                         set text of selection to return  * 
                         select insertion point after selection
                     else
                         set findReco to find ^\\s*\\+ searching in
 lineOfInsertionPoint options {search mode:grep}
                         if found of findReco = true then

                             set text of selection to return  tab  + 
                             select insertion point after selection
                         end if
                     end if
                 end if
             end tell
         on error errMsg number errNum
             set sep to ==
             set e to sep  return  Error:   errMsg  return  sep 
 return ¬
                  Error Number:   errNum  return  sep
             beep
             display dialog e
         end try
     end tell
 ---

 Essentially the \s* helps ignore white space at the beginning. There's just
 one problem with my script. It inserts the new bullet point ignoring the
 previous number of tab stops. Is there a way in applescript to get hold of
 the number of tab stops and insert that at the beginning as well?

 Thanks again.







 On Monday, August 8, 2011 7:04:04 AM UTC+3, Christopher Stone wrote:

  On Aug 07, 2011, at 21:35, oliver wrote:

  I'm thinking it might have to be an AppleScript to select the line and
  then call a Text Filter to handle finding the number/star and appending the
  next one... but my kung fu is not strong enough to figure it out.

  __

  Hey Oliver,

  This is very quick and dirty, but it'll work with the numerical increment
  and the asterisk bullet.

  It's expecting the insertion point (cursor) to be at the end of the line,
  but it could easily be adjusted so that anywhere in the line would do.

  You can put it in the script menu and give it a keyboard shortcut and go
  to town.

  The logic is pretty straightforward, so you can add more characters like
  '•' to the mix if desired.

  --
  Best Regards,
  Chris

  __

  tell application BBEdit
    try
      tell text of front text window
        set lineOfInsertionPoint to line (startLine of selection)
        set findReco to find ^\\d+\\. searching in lineOfInsertionPoint
  options {search mode:grep}
        if found of findReco = true then
          set leadingNumber to text 1 thru -2 of (found text of findReco)
          set text of selection to return  (leadingNumber + 1)  . 
          select insertion point after selection
        else if found of findReco = false then
          set findReco to find ^\\*  searching in lineOfInsertionPoint
  options {search mode:grep}
          if found of findReco = true then
            set text of selection to return  * 
            select insertion point after selection
          end if
        end if
      end tell
    on error errMsg number errNum
      set sep to ==
      set e to sep  return  Error:   errMsg  return  sep  return ¬
         Error Number:   errNum  return  sep
      beep
      display dialog e
    end try
  end tell

-- 
You received this message because you are 

Re: Applescript to check for a selection, then do something

2012-02-01 Thread Kendall Conrad
Yes, you can check the length of the selection to see if anything is
connected and surround that with an if statement. I do it in a script
that I run.



On Feb 1, 1:32 am, Oliver Taylor olivertay...@me.com wrote:
 Is there a way to attach an applescript to a menu-item that checks to see
 if there's a selection?

 I imagine it would go:
 - Is there a selection?
 + if yes: trigger the menu item
 + if no: select the current word/line - then trigger the menu item.

 Perhaps there's no need to attach it to the menu-item… maybe it's just a
 script that checks-for/makes a selection, then calls a specified menu-item.

 Any help would be appreciated.

-- 
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: New Text Document BBedit Extension

2012-01-17 Thread Kendall Conrad
That's accomplished through OSX's interface rather than BBEdit. From
Finder, highlight a file that you want associated with BBEdit, then
right-click on it and choose Get Info. In the popup window that
appears there's a section for declaring what program will open files
of that type. Then there's a button to say apply to all of this type.


On Jan 13, 3:24 am, Jack Stewart ja...@amug.org wrote:
 Is there a file name extension for a new text document which
 will ensure that the file opens in BBEdit when doubleclicked?

 Thanks -- Jack

-- 
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: Changing preferences

2011-12-22 Thread Kendall Conrad
That setting is from the OS. System Preferences  General  Highlight
Color.

-Kendall

On Dec 22, 11:27 am, Linda 1anml...@gmail.com wrote:
 When I perform a search for text, the found result is highlighted in a
 really pale blue color.  Is there a setting in the preferences (that I
 have not been able to find) to change the color so that I can spot the
 found result more easily?

 TIA,
 Linda

-- 
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 opens a file with oriental characters

2011-12-13 Thread Kendall Conrad
The first idea that comes to mind is if the FTP program is attempting
to transfer the file as binary rather than ascii. It would be weird
for it to do that, but would be something to look into. Are you
accessing the file using BBEdit's FTP open capability or a separate
FTP program? The UTF-16 w/BOM could also be the culprit. I come across
many programs that can't handle it, and maybe something goes astray in
the transfer. I generally stick with UTF-8 w/o BOM, and I use Japanese
and English together in my HTML documents.

-Kendall



On Dec 13, 2:52 pm, Tomás García Ferrari
tomasgarciaferr...@gmail.com wrote:
 I am trying to understand a very odd behavior with a file open with BBEdit. 
 The problem is with an HTML file, done by scratch by myself and uploaded to 
 an FTP server. After a while, I have downloaded this file to my local machine 
 and when I open it with BBEdit it is scrambled and it only shows oriental 
 characters (I don't know if chinese or japanese…).

 Checking the file on the command line (with head, tail or vi), it is fine: 
 plain HTML, nothing odd there.

 So, far I have

         – scanned the file with an antivirus and seems to be clean…

         – check the encoding and it is Unicode (UTF-16, with BOM)

 What can be the origin of this problem…? Any suggestion…?

 Kind regards,
 Tomás

 --
 Tomás García Ferrarihttp://bigital.com/

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

2011-08-03 Thread Kendall Conrad
Glad to hear it's working in version 10. I haven't upgraded so hadn't
been able to try it out. As I believe you found, you can enter the
abbreviation directly into a document and use your now working
keyboard shortcut to expand it. It uses the same script for inline
expansion and the pop-up. Which occurs depends on the context.

-Kendall

On Aug 3, 12:27 pm, Rick Yentzer ryent...@gmail.com wrote:
 My apologies, I didn't follow the directions clearly. I got it working once
 I did. Works fine with v10!

 Thanks, Rick

-- 
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 and replace multiple combinations at once?

2011-07-27 Thread Kendall Conrad
I believe Text Factories would be a good solution if it exists in
version 8. I started with version 9 so not sure if that feature
existed yet. I've used them for very similar situations to the one you
describe.



On Jul 27, 1:03 pm, jgold723 jg...@desktoppub.com wrote:
 I'm using BBEdit 8 (but willing to upgrade if necessary). I have a
 series of search and replace strings that I need to perform on a
 document. I'd like to build these once, then have BBEdit run them all
 on the document. Can that be done? How?

 Thanks,

 John

-- 
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-26 Thread Kendall Conrad
I don't have BBEdit 10, but for 9, you go to Languages, then Options
to get to those settings.

-Kendall


On Jul 26, 4:34 pm, Watts Martin lay...@gmail.com wrote:
 One of my clients has decided that PHP documents should use 4-space
 tabs, while PHP *templates* should use 2-space tabs. Is there a way to
 set (ideally persistently) tab width on a per-document basis in BBEdit
 10 other than using the Emacs variable block? (I'd thought that was in
 either Text Options or Document Options in BBEdit 9, although a
 quick check of TextWrangler suggests that's my imagination.)

 --
 Watts Martin lay...@gmail.com

  smime.p7s
 5KViewDownload

-- 
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: Trying out BBEdit

2011-07-19 Thread Kendall Conrad
Shortcut for scrolling window while keeping cursor position is control-
up/down. You can also do control+option-up/down (for 3 lines) and
control+option+command-up/down (for 6 lines).

Tab size can be defined per document type in the preferences (at least
for version 9). Preferences  Languages  Pick one  Options.

The user manual has a lot of this kind of information as well. It's
long, but lots of good info. I don't have version 10 so can't address
the ? issue in preferences.

-Kendall


On Jul 19, 3:57 pm, vr8ce ricepad...@gmail.com wrote:
 Trying BBEdit 10 on a MacBook Pro, OS X 10.6.8.

 I'm a semi-recent Windows switcher, and still in Windows regularly via
 Fusion (have to for some client programs, etc.). Most of my editing
 has thus been in the Windows environment. Overall I'm very impressed
 with BBEdit so far.

 I'm looking for an option to have the insertion point follow the
 cursor. That is, if I'm at the top of a document, and hit the Page
 Down key three or four times, I want the current line to be the top of
 the window, so that, if I hit the down arrow, e.g., I'm on the second
 line of the current window, instead of being taken back to the second
 line of the document.

 I've looked through all the preferences, including the Expert ones in
 the help (happened to see mention of them elsewhere), but I can't find
 anything, or if I saw it, I didn't recognize it. :) Does this
 capability exist?

 Also, while the Preference window is open, clicking the ? button in
 the lower right results in a Help Viewer cannot open this content.
 error, and then a blank Help window.

 As possible future enhancements, there are a few global settings that
 it would be very helpful to have as language-specific:
 o  Tabs — We use different tab stops in different types of source
 files (C++ vs SQL, e.g.)
 o  Stripping trailing white space — we want to do this on source
 files, but not straight text files (that might contain text data,
 e.g.)

-- 
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 current file in BBEdit in other application

2011-07-02 Thread Kendall Conrad
Your attempt is close. Here's a script that is working for me. You cn
comment out the do shell line with -- at the beginning of the line
and uncomment the line above it to see the file path that it will try
to open for testing.

tell application BBEdit
set _file to file of front window
--display dialog File:   quoted form of (POSIX path of _file)
do shell script open -a TextEdit   quoted form of (POSIX path of
_file)
end tell


-Kendall

On Jul 2, 4:33 pm, TJ Luoma luo...@gmail.com wrote:
 {Let me preface this by saying that I don't know jack about
 AppleScript. I've been googling around (and even checked the manual)
 and can't find anything like this, so I'm guessing it's so basic no
 one thinks anyone has to be told how to do this.}

 Problem: I want to open the front-most file in BBEdit in another
 application by pressing some keyboard command.

 Let's say the other application is TextEdit, but it could be any
 application.

 On page 322 of the manual (see, I read it :-) it says:

  Although BBEdit still supports the “active document” property, this is no 
  longer necessary. Instead, if a text window is frontmost:

  document 1 of application BBEdit
  document 1 of text window 1 of application BBEdit
  active document of text window 1 of application BBEdit

  now all refer to the same document.

 So, cobbling together that with other stuff from around the web (lots
 of which is old and confusing)

 I tried this:

         tell application BBEdit
                 set thefile to document 1 of application BBEdit
                 set thepath to POSIX path of thefile
         end tell

         do shell script open -e   thepath

 I also tried it without the tell / end tell lines

 But I always get an error such as this:

 https://skitch.com/luomat/f8had/bbedit-as-error

 BBEdit got an error: Can't make POSIX path of text document into type
 POSIX path of text document 1.

 which tells me absolutely nothing helpful.

 Can someone:

 1.      point me in the right direction?

 2.      recommend a good AppleScript for beginners book?

-- 
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 Kendall Conrad
From the Markup menu, at the bottom there's a Preview in that will
list your browsers (configurable from Preferences). You can also
assign a keyboard shortcut for it if you want from Preferences.


On Jun 14, 6:37 pm, Lorel i...@loriswebs.com wrote:
 I would like to know if it's possible to open an html document in a
 browser window from inside BBedit

-- 
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 change selected text to lower case-- without affecting URLs

2011-05-22 Thread Kendall Conrad
Here's something to try. I only tested it on a couple test cases.

Regex find: ([^]*)

Replace with: \L\1

-Kendall

On May 22, 3:36 am, ChristianBoyce mac...@christianboyce.com wrote:
 It would have been easier to help me if I'd stated the problem more
 accurately.

 I am going to have some text that is HTML tags and other text that is
 not. I simply want to skip over the stuff that is HTML tags. Sounds
 easy-- if it's inside of angle brackets, don't change it.

 Example:

 A HREF=http://www.drseuss.com/THE-CAT-IN-THE-HAT.png;THE-CAT-IN-THE-
 HAT/A becomes
 A HREF=http://www.drseuss.com/THE-CAT-IN-THE-HAT.png;the-cat-in-the-
 hat/A

 The problem is, I can't figure out how to say if it's in angle
 brackets, don't change it. There is no telling what will be inside
 those brackets.

 Thanks again for your help.

 c

 On May 21, 11:40 pm, Maarten Sneep maarten.sn...@xs4all.nl wrote:







  Op 22 mei 2011 om 05:14 heeft ChristianBoyce mac...@christianboyce.com 
  het volgende geschreven:

   But, if I have something like this:

   IT WAS A LOW-BUDGET AFFAIR and their WEBSITE ADDRESS 
   washttp://www.LOW-BUDGET.com;
   I don't want to change the URL. Basically, I want to leave URLs
   untouched. It should look like this: it was a low-budget affair and
   their website address washttp://www.LOW-BUDGET.com;. (I want to do it
   all in one move-- select the entire chunk of text, apply the GREP
   command.)

   I am using GREP rather than just changing case in BBEdit because I
   want to protect the URLs. A given chunk of text will be a mixture of
   upper case text, lower case text, and URLS. I'm trying to select a
   bunch of text, apply my GREP command, and do a change case that
   ignores URLs.

  Rightly so, urls are care insensitive. Why bother keeping the original case 
  for exactly that part?

  Maarten

-- 
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: Copy Paste Wrap

2011-04-21 Thread Kendall Conrad
You should take a look at Zen Coding. It lets you wrap selected text
with HTML tags and other code. I wrote the BBEdit/TextWrangler version
of it. I created additional snippets for PHP for my setup and is easy
to add to. It's very similar to Clippings, but can give you different
behaviors as well, which may be beneficial to what you're trying to
do, and allows you to incorporate the Clipping syntax.

http://code.google.com/p/zen-coding/

-Kendall


On Apr 21, 4:08 pm, Robert Huttinger roberthuttin...@gmail.com
wrote:
 ill look into that. I think the tag example was bad because mostly I am not
 trying to do this with code snippets.

 I have a huge clippings library on dropbox for all my workstations,

 I have found that sometimes the clipping auto complete is context sensitive.
 I wish it werent so 'smart' as I like to mix my types for type testing, code
 checking etc. like before I can  start typing php_preg_repl I have to
 save the document as a php document. I guess I can use scratchpad for this?

 I do like the select,  clippings replace, then paste option though.

 cheers.bo







 On Thu, Apr 21, 2011 at 3:59 PM, Tim Gray tg...@125px.com wrote:
  On Apr 21, 2011 at 10:54 AM -0700, Bo wrote:

  Is there a way to paste / wrap.

  for example, I select the word 'frack' in an html document is it
  somehow possible for me to copy strong/strong tags, then paste
  'over' the selected text to wrap the selected text with the tags?

  You can do this with clippings.  Select some text, trigger your clipping,
  and have the selected text appear in between your tags - if the clipping is
  defined in that manner.

  However, if you working with HTML, there's a much better way to do this.
   Use the Markup-Tag Maker command.  I have it bound to cmd-m.  It's a life
  saver with html.  Select your text, hit cmd-m, start typing in 'strong'
  until you get the right element in the popup and hit enter.

  --
  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 
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: Syntax aware auto-indent?

2011-04-11 Thread Kendall Conrad
Here's two AppleScript scripts that I wrote for this type of thing. I
think I made it after a discussion here actually. I have it set with
cmd+return / cmd+shift+return. It handles cases for JavaDoc (/**),
open curly, colon, and by default will just move down a line with the
correct indentation. One benefit is it allows you to execute it no
matter where you're at on the current line. It just looks at the end
of the current line to determine what to do.

The second script is similar except it will create a new line above
the current one with correct indentation and can be executed from
anywhere on the current line. I made these to mimic vim's o and O
commands, though I added extras for o to have some extra output.

Hope these help. They're not automatic, but I have found them very
helpful in coding.

-Kendall

(*
Author: Kendall Conrad of Angelwatt.com
Name: Smart Newline
Created: 2010-01-23
Description: Based on the current line it will generate different
text for the context. It knows about indentation, code doc syntax,
function starts
*)
tell application BBEdit to tell front window
activate
set lineNum to startLine of selection
set leng to length of line lineNum
-- Move cursor to end of line
if leng  0 then
select insertion point after (character (leng) of line lineNum)
end if

-- Find leading whitespace
set theResult to find (^[\\s]*) options {search mode:grep}
searching in line (lineNum)
-- Set text to the white space found
set white to 
if found of theResult then
set white to found text of theResult
end if
set wleng to length of white

-- Are we starting a code doc?
if (leng - wleng) ≥ 3 then
if (characters (wleng + 1) through (wleng + 3) of line lineNum 
as
string) is equal to /** then
set selection to return  white   *   return  
white   */
select insertion point after line (lineNum + 1)
return
end if
end if

-- Check if inside a code doc
if (leng - wleng) ≥ 1 then
if (characters (wleng + 1) through (wleng + 2) of line lineNum 
as
string) is equal to *  then
set selection to return  white  * 
select insertion point after line (lineNum + 1)
return
end if
end if

-- Check for code block {}
if (leng - wleng) ≥ 1 then
if (character -1 of line lineNum as string) is equal to { then
set selection to return  white  tab  return  white 
 }
select insertion point after line (lineNum + 1)
return
end if
end if

-- Check for code block : (Python)
if (leng - wleng) ≥ 1 then
if (character -1 of line lineNum as string) is equal to : then
set selection to return  white  tab
select insertion point after line (lineNum + 1)
return
end if
end if

-- Default: Insert a return plus the white space
set selection to return  white
select insertion point after selection
end tell

-

(*
Author: Kendall Conrad of Angelwatt.com
Name: OpenLineUp
Created: 2010-01-18
Description: Creates a new line above the line currently on at
appropriate indent level
*)
tell application BBEdit to tell front window
activate
set lineNum to startLine of selection
set leng to length of line lineNum
-- Move cursor to start of line
if leng  0 then
select insertion point before (character 1 of line lineNum)
end if
-- Find leading whitespace
set theResult to find (^[\\s]*) options {search mode:grep}
searching in line (lineNum)
-- Set text to the white space found
set white to 
if found of theResult then
set white to found text of theResult
end if
-- Insert a return plus the white space
set selection to white  return
select insertion point before (character -1 of selection)
end tell


On Apr 11, 2:24 pm, Robert Rollins coredumper...@gmail.com wrote:
 Hi all!  I recently started checking out BBEdit as an alternative
 development platform to Eclipse and TextMate, and so far I like it a
 lot.  But there's one thing I'm really missing: syntax aware (smart)
 auto-indent.

 When a PHP programmer types an open curly bracket (or a Python
 programmer types a colon) then presses Return, the expectation is that
 the cursor will appear indented one tab further to the right than the
 above line.  However, BBEdit's auto-indent brings the cursor to the
 same level

Re: Expand selection by paragraph

2011-03-28 Thread Kendall Conrad
I'm not at my Mac to try this, but I think the logic would be
something along the lines of:

set selection to (character 1 of selection) to (character after found
object of result)



On Mar 27, 9:56 pm, Rick rrto...@gmail.com wrote:
 I know it is possible to select a paragraph with command+option+L. I
 also have an apple script that can jump the insertion point by a
 paragraph:

 tell application BBEdit
         find ^[\\r]+ searching in (text 1 of window 1) options {search
 mode:grep, starting at top:false, wrap around:true, backwards:false,
 case sensitive:false, match words:false, extend selection:false} with
 selecting match
         select insertion point after found object of result
 end tell

 Does anyone know how I might alter this script so that in addition to
 moving the insertion point. the selection will be expanded along with,
 so that a selection could be increased one paragraph at a time. This
 would be useful, as I often want to extend the current selection by
 more than one line (shift+down) but by less than one screen (shift
 +option+down) or to the end of the document ( shift+command+down).
 Would be great if shift+control+down just extended to the next
 whitespace line.

-- 
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: Attaching a CSS style sheet to a new HTML doc.

2011-03-13 Thread Kendall Conrad
The examples you give are relative paths, not absolute. Absolute path
is define as, The complete path to a resource, independent of the
location of the visited page. (src: 
http://webmaster.multimania.co.uk/glossary/)


On Mar 13, 9:03 am, RobS rsteven...@accesscable.net wrote:
 On Mar 12, 9:19 pm, Kendall Conrad angelw...@gmail.com wrote:

  Absolute is based on the root of the web site. The below assumes you
  have a folder named css at the top level of your site.
  link rel=stylesheet href=/css/style.css /

 That would only be true if there was just one layer in the site. The
 OP may need to reference it absolutely as
 link rel=stylesheet href=../../css/style.css /, or even
 link rel=stylesheet href=../../../css/style.css /, depending on
 how deep the folders go. (I manage a large complex site which uses
 just this method. It's easy to maintain.)

 Rob

-- 
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: File List button in search results

2011-03-10 Thread Kendall Conrad
I'm using BBEdit 9.6.3, and that button isn't in my search result
window either. I guess they removed it.



On Mar 10, 10:20 pm, Gregg Thomason gregg.thoma...@gmail.com wrote:
 I'm trying to find the File List button mentioned on page 152 of the
 manual (screen shot on page 151). No where to be seen in any find results I
 do. Does it still exist?

 Thanks,

-- 
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 and re-opening multiple directories/pages as a group

2011-01-21 Thread Kendall Conrad
Isn't that what BBEdit's Project feature does? File  New  Project.

-Kendall

On Jan 21, 12:44 pm, Kyle Thomas eworld...@gmail.com wrote:
 Is there an easy way I can save a project with multiple directories  
 and multiple pages so I can reopen it again as it was when I was last  
 working on 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 equivalent of Ctrl-O (open line)

2011-01-20 Thread Kendall Conrad
It looks like I was over-thinking it. I didn't realize you _only_
needed to handle the case when you were at the end of a line. I was
thinking of vim's command that will create a new line below/above your
current position, no matter where your cursor was currently at on a
line. The scripts I gave before could be simplified quite a bit based
on your need, but the clipping approach is simpler still.

-Kendall


On Jan 20, 12:12 am, Watts Martin lay...@gmail.com wrote:
 On Jan 19, 5:25 am, Roland Küffner medienmeis...@googlemail.com
 wrote:

  I'm not quite sure if I understood the wished behavior right, but how about 
  doing this with a simple clipping (which can easily get it's own keyboard 
  shortcut)?

 I didn't even think of using clippings -- my BBEdit skills have
 atrophied over the years. (I've been using another text editor which
 we shall refer to as The One Whose Next Version Never Ships.)

 Thanks for this -- but it seems the #INDENT# placeholder doesn't
 actually insert a tag; it just makes it so the clipping text is
 indented to the current level. If I make the clipping file into:

 return
 #INDENT#tab#INSERTION#

 ...it will work as expected with one big caveat: it will always insert
 a hard tab character rather than respecting the auto-expand tab
 setting.

 However, this did point me in the right direction: I've created a very
 simple AppleScript which returns either a hard tab or a string of
 spaces equivalent to the tab width setting based on whether expand
 tabs it set, and called it from the clipping:

 #INDENT##script maketabs.scpt##INSERTION#

 ...so, thank you!

-- 
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 equivalent of Ctrl-O (open line)

2011-01-18 Thread Kendall Conrad
System events are certainly the easier (shorter) way to do it:
---
tell application BBEdit to tell front window
activate
tell application System Events to keystroke end
tell application System Events to keystroke return
tell application System Events to keystroke tab
end tell
---

Here is at least one way to do it with just BBEdit's capabilities:
---
tell application BBEdit to tell front window
set lineNum to startLine of selection
set leng to length of line lineNum
-- Move cursor to end of line
if leng  0 then
select insertion point after (character (leng) of line lineNum)
end if
-- Find leading whitespace
set theResult to find (^[\\s]*) options {search mode:grep}
searching in line (lineNum)
-- Set text to the white space found
set white to 
if found of theResult then
set white to found text of theResult
end if
-- Add extra indent
set white to white  tab
-- Insert a return plus the white space
set selection to return  white
select insertion point after selection
end tell
---

I assumed you were using tabs for indentation. A little surprisingly,
the BBEdit way executed quicker. The system events way also has issues
if you're holding down any modifier keys (e.g., command, control) as
those keys will be attached to the system events when it does the
keystroke. Not so great. I haven't thoroughly tested either solution
FYI.

-Kendall


On Jan 18, 5:31 pm, Watts Martin lay...@gmail.com wrote:
 I'm working on a little AppleScript that replicates a trivial but
 cherished feature of another editor -- being able to press Ctrl-Return
 (or whatever) and having it start the new line with an appropriate
 indent.

 My script does the right thing now as long as there's nothing on the
 line below where it's executed, but what I'd really like to have
 happen is the equivalent of the Open Line, i.e., when you invoke the
 script at the end of a line that's followed by another one, the second
 line is moved down:

 text here
     |
 text here

 Since my script currently just inserts a return followed by the
 appropriate number of spaces or tabs to indent one tab stop past the
 start of the line it was invoked on, it makes a cheerful mess of
 things in this case. Using Open Line would be much better, I suspect
 -- but I can't figure out how to do so from the dictionary alone. Is
 there a way to actually invoke the Open Line command with BBEdit's
 dictionary, or do I need to go through System Events to pull this off?

-- 
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: Auto-fill CSS values and shortcut for wrapping HTML tags around selected text?

2011-01-11 Thread Kendall Conrad
I suggest using the Zen Coding scripts I made (http://
www.angelwatt.com/coding/zen-coding_bbedit.php), which allow for
quickly writing HTML including wrapping it around selected text. This
can also help with your CSS. You can use the abbreviation bgr:n and
that expands to background-repeat: no-repeat;

-Kendall

On Jan 11, 7:59 pm, mhulse rgmi...@gmail.com wrote:
 Hi!

 Two questions (using BBEdit 9.6.2):

 1.

 How can I have BBEdit fill-in CSS property values?

 When I am working via a CSS doc, BBEdit will auto-fill/suggest CSS
 properties, but not values. The closest BBEdit comes to suggesting
 anything is this:

 ##

 Which is fine. Here is an explanation of what the above is supposed to
 be:

 [[

 The ## is a placeholder; if you press the Tab key or use Go to
 Next Placeholder (or Go to Previous Placeholder) on the Search
 menu, it gets selected and you can simply type to fill it in.

 ]]

 I don't know about ya'll, but that is not so helpful to me... I don't
 typically write out properties and then go back and fill-in the
 values.

 Any tips on how to get BBEdit to auto-fill values also? Are there any
 plugins? Am I just missing something here?

 I personally think Dreamweaver does a great job at hinting/auto-
 filling CSS (and many other langs). I wish BBEdit had the hint/auto-
 fill feature of DW.

 2.

 In Dreamweaver, I can select some text and use Command-T to wrap
 selected text with an HTML tag.

 Is there something similar in BBEdit? I really miss this feature as it
 speeds up some of the mundane HTML formatting work.

 Thanks!
 Micky

-- 
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 9.6.2 screws up Applescripts

2010-12-17 Thread Kendall Conrad
Can you provide a sample script that this happens with? My AppleScript
scripts seem to be working fine.



On Dec 17, 1:51 pm, Lazeez laze...@gmail.com wrote:
 I have multiple scripts that clean up text. After updating to 9.6.2, I
 can no longer use them. Each time I run a script (which may be
 composed of 50 or more 'replace' statements) I get a '{string}' (where
 string is the term to replace) not found report dialog box for each
 replace statement that fails, along with a beep and an OK button.

 Also, in a script that doesn't try to save the document, I get a save
 dialog!

 I was forced to revert to 9.6.1 to continue working.

 Is there anything that I can do to restore the old behaviour with
 9.6.2 or should I stick with 9.6.1 for the foreseeable future?

-- 
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: not beginning-of-line followed by string

2010-12-14 Thread Kendall Conrad
The easiest way off hand that I can think of would be:

find: (./p)$
replace with: \n\1


On Dec 14, 12:06 pm, Dave Ratcliffe dtratcli...@gmail.com wrote:
 I'm trying to replace the following sort of strings in a very large
 text file (where “some_text” is one or more of any group of printable
 characters, and “$” is eol):

 some_text/p

 with:

 some_text$
 /p

 And I'm trying, unsuccessfully, to remember how to write the
 expression in the Find: text box of the Find window that uses the '^'
 character in both forms as “beginning-of-line” and as the “not”
 operator.  In English, it would be writing a regular expression for
 something like:

 For every occurrence of not-the-beginning-of-line, followed by “/p”,
 insert a line feed in front of “/p”.

 I may be mixing up grep that I’m used to using in vi with grep the way
 it’s implemented in bbedit.

 I would be very grateful to learn some way of inserting a “\n” line
 feed in between “some_text” and “/p”

 Running bbedit 9.6.1 on Mac OS 10.5.8.

-- 
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 i disable the help keyboard shortcut near the backspace key?

2010-11-05 Thread Kendall Conrad
Are you talking about the code-completion feature? If so, it can be
turned off in Preferences  Editing: General  Top of the right panel.
I have mine setup to only come up with a keypress for Complete.


On Nov 4, 10:51 pm, blinde bruce.li...@gmail.com wrote:
 gang -

 it drives me crazy... i kicking out code, i hit the backspace key to
 delete a typo, and suddenly i'm waiting while the help stuff comes
 up... help i don't want, help i don't need, and help that doesn't help
 me with my current question!   8-)

 is there a way to accomplish this?

 please let me know,
 thanks,
 bli...@5happy.com

-- 
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: Newbie: Scripting a better HOME button?

2010-08-06 Thread Kendall Conrad
I've learned AppleScript over the years casually from online resources
mostly and downloading other people's code, such as picking up some
new things from John's code that he provided. I'm good with other
programming languages, but Applescript was a very different kind of
language.

I hadn't tested the code with multiple lines. I guess the desired
effect would just to ignore it possible in order to avoid the errror,
maybe. I'll have to think about it.

-Kendall

On Aug 6, 10:54 am, offtone aaro...@gmail.com wrote:
 Thank you, Kendall, for that. It's nearly perfect (throws an error if
 more than one line is selected). Both are now bound to CMD+LEFT and CMD
 +SHIFT+LEFT respectively, and working pretty much identically to those
 other IDEs and text editors! I may need to buy a book on Apple Script,
 I think. Haha. The library seems totally insufficient for learning
 it on its own. Did you learn it through experimentation, or books,
 or...? I'm a graphic designer and I have a feeling I could do some
 pretty sweet things with Illustrator and Photoshop too, if I could
 just get a grip on the language.

 I may fire off an e-mail to Bare Bones with a link to this thread. I'm
 sure they'd be willing to implement this on their own.

 Thanks again!

 On Aug 5, 9:11 pm, Kendall Conrad angelw...@gmail.com wrote:







  I had some time, so I worked on this. It's very close to the other
  script and doesn't replace it, so a different keyboard shortcut should
  be used, like the one you suggest, which is what I was practicing
  with.

  -
  tell application BBEdit to tell front window
          -- Grab line number and offset of text cursor
          tell the selection to set {_n, _selectionstart} to {startLine,
  characterOffset}
          set _selectLength to length of (contents of selection as text)
          if (_selectLength)  0 then
                  set _selectionstart to _selectionstart + _selectLength
          end if
          -- Grab offset of line in the document and the contents of the line
          tell line _n to set {_linestart, _line} to {characterOffset,
  contents}
          set _cursor to _selectionstart - _linestart
          if _cursor = 0 then return
          set _smart to 0
          -- Go through content of line looking for smart home position
          set _len to count _line
          -- Ensure line is not empty
          if _len = 0 then return
          -- Traverse line to find first non-whitespace
          repeat with _i from 1 to _len
                  if item _i of _line is not in {space, tab, ASCII character 
  202} then
                          set _smart to _i - 1
                          exit repeat
                  else
                          set _smart to _len
                  end if
          end repeat
          -- Ensure smart is not past cursor
          if _smart  _cursor then set _smart to _cursor
          -- Check if not at smart position already
          if (_selectLength = 0 or _selectLength = _cursor) and _smart is not
  _cursor then
                  select characters (_smart + 1) through _cursor of line _n
          else -- Just go to start of line
                  select characters 1 through _cursor of line _n
          end if
  end tell
  -

  -Kendall

  On Aug 4, 10:10 pm, offtone aaro...@gmail.com wrote:

   Ah, Delacour's and Conrad's solution seems to be pretty much spot on.
   I've been wrestling with it a bit and still can't get the bugger to
   behave the same when the SHIFT key is held down -- that is, using the
   same Smart Home behaviour while trying to SELECT to the start of the
   line. It ought to first select to the intelligent beginning of the
   line, and then another press ought to extend it to include any
   whitespace, and then susequent presses would flip-flop between the two
   as this script is doing now (wonderfully).

   And Mr. Roth, I'm glad you've found it helpful! Thanks again to
   everyone who's contributed; wouldn't be working if it weren't for
   them. Clearly I'm incapable. Haha. And hopefully more people discover
   this discussion and find it useful, too. I was shocked to have found
   it missing from BBEdit, as it seems to do most everything else, and
   then some!

   On Jul 31, 10:10 pm, John Delacour johndelac...@gmail.com wrote:

At 15:47 -0700 31/7/10, Kendall Conrad wrote:

With more testing I found there were some cases where the script
didn't work so I have made further improvements. Below is the new
script. I set command+left to be the shortcut for it, which works out
pretty well.

Applescript is verbose enough without any help at all!  Here's  a
trimmed down version that takes account of the no-break space.

tell application BBEdit to tell front window
   tell the selection to set {_n, _selectionstart} to {startLine,
characterOffset}
   tell line _n to set {_linestart, _line} to {characterOffset, 
contents}
   set _cursor to _selectionstart

Re: Newbie: Scripting a better HOME button?

2010-08-06 Thread Kendall Conrad
I fixed the issue of multiple lines being selected when you use it. I
think some of the math can be simplified, but I wasn't up for it as
everything seemed to work right.


tell application BBEdit to tell front window
-- Grab line number and offset of text cursor
tell the selection to set {_n, _selectionstart} to {startLine,
characterOffset}
set _selectLength to length of (contents of selection as text)
if (_selectLength)  0 then
set _selectionstart to _selectionstart + _selectLength
end if
-- Grab offset of line in the document and the contents of the line
tell line _n to set {_linestart, _line} to {characterOffset,
contents}
set _cursor to _selectionstart - _linestart
if _cursor = 0 then return
set _smart to 0
-- Go through content of line looking for smart home position
set _len to count _line
-- Ensure line is not empty
if _len = 0 then return
-- Traverse line to find first non-whitespace
repeat with _i from 1 to _len
if item _i of _line is not in {space, tab, ASCII character 202} 
then
set _smart to _i - 1
exit repeat
else
set _smart to _len
end if
end repeat
-- Ensure smart is not past cursor
if _smart  _cursor then set _smart to _cursor
-- Check if smart position is where cursor is, if so select from
start of line
if _smart is _cursor or (_cursor - _selectLength = _smart) then
select (characters (_selectionstart - _cursor) through
(_selectionstart - 1))
else -- Select from smart position
select (characters (_selectionstart - _cursor + _smart) through
(_selectionstart - 1))
end if
end tell


-Kendall


On Aug 6, 10:54 am, offtone aaro...@gmail.com wrote:
 Thank you, Kendall, for that. It's nearly perfect (throws an error if
 more than one line is selected). Both are now bound to CMD+LEFT and CMD
 +SHIFT+LEFT respectively, and working pretty much identically to those
 other IDEs and text editors! I may need to buy a book on Apple Script,
 I think. Haha. The library seems totally insufficient for learning
 it on its own. Did you learn it through experimentation, or books,
 or...? I'm a graphic designer and I have a feeling I could do some
 pretty sweet things with Illustrator and Photoshop too, if I could
 just get a grip on the language.

 I may fire off an e-mail to Bare Bones with a link to this thread. I'm
 sure they'd be willing to implement this on their own.

 Thanks again!


-- 
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: Select text after paste

2010-08-05 Thread Kendall Conrad
One idea. Create some AppleScript that does a Special Paste that finds
out what column you're using indented at then applies the indentation
to to everything after the first line of the text on the clipboard,
then pastes the resulting text into the document. So it doesn't
directly do what you want, but allows you to pre-process rather than
post-process.

I suppose you may be able to create a different kind of script that
records the initial cursor position, and after pasting, will select
back to that point. I think that's doable and would be less code than
the above idea.

-Kendall


On Aug 5, 9:49 am, Tom tklin...@gmail.com wrote:
 Is there any way to have the block of text that I have pasted into a
 document be automatically selected so I can then use other commands on
 that text immediately?

 For example, I usually Shift-left or right the block so the pasted
 code has the right indentation to match the surrounding code.  I find
 it annoying to go from the keyboard using Command-V to the mouse to
 reselect the block I just inserted to then go back to the keyboard and
 use Command-[ or Command-].  This is even more annoying when the
 inserted block of code is more than a page length.

 Any suggestions?

 Thanks
 Tom

-- 
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: Select text after paste

2010-08-05 Thread Kendall Conrad
I went ahead and tried coding up my second suggestion. It was really
easy actually. I haven't done a ton of testing with it, but seems
pretty good. Just select your content and run this script and it will
paste it into the document and select it.

tell application BBEdit to tell front window
-- Ensure clipboard is not empty
if (length of (contents of (the clipboard as text))) = 0 then return
tell the selection to set offset1 to characterOffset
paste
tell the selection to set offset2 to characterOffset
select (characters offset1 through (offset2 - 1))
end tell

-Kendall

On Aug 5, 4:47 pm, Kendall Conrad angelw...@gmail.com wrote:
 One idea. Create some AppleScript that does a Special Paste that finds
 out what column you're using indented at then applies the indentation
 to to everything after the first line of the text on the clipboard,
 then pastes the resulting text into the document. So it doesn't
 directly do what you want, but allows you to pre-process rather than
 post-process.

 I suppose you may be able to create a different kind of script that
 records the initial cursor position, and after pasting, will select
 back to that point. I think that's doable and would be less code than
 the above idea.

 -Kendall


-- 
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: Newbie: Scripting a better HOME button?

2010-08-05 Thread Kendall Conrad
I had some time, so I worked on this. It's very close to the other
script and doesn't replace it, so a different keyboard shortcut should
be used, like the one you suggest, which is what I was practicing
with.

-
tell application BBEdit to tell front window
-- Grab line number and offset of text cursor
tell the selection to set {_n, _selectionstart} to {startLine,
characterOffset}
set _selectLength to length of (contents of selection as text)
if (_selectLength)  0 then
set _selectionstart to _selectionstart + _selectLength
end if
-- Grab offset of line in the document and the contents of the line
tell line _n to set {_linestart, _line} to {characterOffset,
contents}
set _cursor to _selectionstart - _linestart
if _cursor = 0 then return
set _smart to 0
-- Go through content of line looking for smart home position
set _len to count _line
-- Ensure line is not empty
if _len = 0 then return
-- Traverse line to find first non-whitespace
repeat with _i from 1 to _len
if item _i of _line is not in {space, tab, ASCII character 202} 
then
set _smart to _i - 1
exit repeat
else
set _smart to _len
end if
end repeat
-- Ensure smart is not past cursor
if _smart  _cursor then set _smart to _cursor
-- Check if not at smart position already
if (_selectLength = 0 or _selectLength = _cursor) and _smart is not
_cursor then
select characters (_smart + 1) through _cursor of line _n
else -- Just go to start of line
select characters 1 through _cursor of line _n
end if
end tell
-

-Kendall

On Aug 4, 10:10 pm, offtone aaro...@gmail.com wrote:
 Ah, Delacour's and Conrad's solution seems to be pretty much spot on.
 I've been wrestling with it a bit and still can't get the bugger to
 behave the same when the SHIFT key is held down -- that is, using the
 same Smart Home behaviour while trying to SELECT to the start of the
 line. It ought to first select to the intelligent beginning of the
 line, and then another press ought to extend it to include any
 whitespace, and then susequent presses would flip-flop between the two
 as this script is doing now (wonderfully).

 And Mr. Roth, I'm glad you've found it helpful! Thanks again to
 everyone who's contributed; wouldn't be working if it weren't for
 them. Clearly I'm incapable. Haha. And hopefully more people discover
 this discussion and find it useful, too. I was shocked to have found
 it missing from BBEdit, as it seems to do most everything else, and
 then some!

 On Jul 31, 10:10 pm, John Delacour johndelac...@gmail.com wrote:

  At 15:47 -0700 31/7/10, Kendall Conrad wrote:

  With more testing I found there were some cases where the script
  didn't work so I have made further improvements. Below is the new
  script. I set command+left to be the shortcut for it, which works out
  pretty well.

  Applescript is verbose enough without any help at all!  Here's  a
  trimmed down version that takes account of the no-break space.

  tell application BBEdit to tell front window
     tell the selection to set {_n, _selectionstart} to {startLine,
  characterOffset}
     tell line _n to set {_linestart, _line} to {characterOffset, contents}
     set _cursor to _selectionstart - _linestart
     set _smart to 0
     set _linelength to count _line
     if _linelength = 0 then return
     repeat with _i from 1 to _linelength
       if item _i of _line is not in {space, tab, ASCII character 202} then
         set _smart to _i - 1
         exit repeat
       else
         set _smart to _linelength
       end if
     end repeat
     if _smart = 0 then
       set _smart to 1
       set _cursor to 1
     end if
     if _cursor is not _smart then
       select insertion point after character _smart of line _n
     else
       select insertion point before line _n
     end if
  end tell

  -
  tell application BBEdit
      -- Find the character offset for the cursor position
      set aaa to (characterOffset of line (startLine of selection)) of
  front window
      set zzz to (characterOffset of selection)
      set _cursor to zzz - aaa
      set _smart to 0

      -- Get the column number of the first non-whitespace character
      set _line to contents of line (startLine of selection) of front
  window
      -- Ensure line is not empty
      if (count _line) = 0 then return

      -- Go through content of line looking for smart home position
      set _len to count (_line as text)
      repeat with _i from 1 to _len
              if item _i of _line is not in {space, tab} then
                      set _smart to _i - 1
                      exit repeat
              end if
      end repeat

      -- Check if we

Re: Newbie: Scripting a better HOME button?

2010-07-31 Thread Kendall Conrad
I reworked your code some and got it to work properly as far as my
testing found.

-
tell application BBEdit
activate

set _current_line_number to startLine of selection
-- Find the character offset for the cursor position
set aaa to (characterOffset of line (startLine of selection)) of
front window
set zzz to (characterOffset of selection)
set _current_point to zzz - aaa

-- Get the column number of the first non-whitespace character
set _line_contents to contents of line _current_line_number of front
window
set _chars to characters of _line_contents
repeat with _i from 1 to count _chars
if item _i of _chars is not in {space, tab} then
set _first_non_whitespace_char to _i
exit repeat
end if
end repeat
set _smart_point to _first_non_whitespace_char
select (character (_smart_point) of line (startLine of selection) of
front window)
select insertion point before selection of front window
tell application System Events
if _current_point is equal to (_smart_point - 1) then
-- Just go to start of line
key code 123 using command down
end if
end tell
end tell
--

-Kendall

On Jul 30, 1:45 pm, offtone aaro...@gmail.com wrote:
 Why isn't this working? For some reason _current_point and
 _smart_point never match... Even when I run it with the cursor before
 the first non-whitespace character (at the smart point, basically).

 And how would I go about getting the startColumn of a character in the
 line? Is there a shortcut for that, or would I have to iterate each
 character and basically count a tab as 4 columns (which may even
 change depending on user preferences...)?

 What I have so far (Frankensteined from posts above):

 tell application BBEdit
         activate

         set _current_line_number to startLine of selection
         set _current_point to insertion point

         -- Get the column number of the first non-whitespace character
         tell the front document
                 set _line_contents to contents of line _current_line_number
                 set _chars to characters of _line_contents
                 repeat with _i from 1 to count _chars
                         if item _i of _chars is not in {space, tab} then
                                 set _first_non_whitespace_char to _i
                                 exit repeat
                         end if
                 end repeat
                 set _smart_point to (get insertion point before character
 _first_non_whitespace_char of line _current_line_number)
         end tell

         tell application System Events
                 if _current_point is equal to _smart_point then
                         -- Just go to start of line
                         key code 123 using command down
                 else
                         -- Go to start of line, then skip over whitespace
                         key code 123 using {shift down, command down}
                         key code 124 using {shift down, option down}
                 end if
         end tell
 end tell

-- 
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: Newbie: Scripting a better HOME button?

2010-07-31 Thread Kendall Conrad
Well, offtone was wanting the script to first go to the smart home
position, and if done again, would go to the start of the line, and if
already at the start of the line, would go to the smart home. The same
behavior often found in IDEs like NetBeans when using the home key.
Your script only went to the smart home, so it was not a full
solution to his problem. It should be obvious he tried your script as
he used most of it in the script he posted.

-Kendall

On Jul 31, 9:30 am, John Delacour johndelac...@gmail.com wrote:
 At 08:52 -0700 30/7/10, offtone wrote:

 I'll tinker around! Some solutions have already been posted, and
 they're helpful starts for sure.

 The script I posted is more than a helpful start; it is a full
 solution.  Have you tried it?!

 JD

-- 
You received this message because you are subscribed to the 
BBEdit Talk discussion group on Google Groups.
To post to this group, send email to 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: Newbie: Scripting a better HOME button?

2010-07-29 Thread Kendall Conrad
From AppleScript Editor you can open dictionaries for each
application. Check out BBEdit's and look for the pieces that let you
look at the current line, then you can make use of the regex you gave
combined with grep search and you should be on your way pretty
quickly. Getting use to the Applescript language will be the biggest
hurdle.

-Kendall

On Jul 29, 4:37 pm, offtone aaro...@gmail.com wrote:
 I'm more of a web developer and am brand new to OS X/Apple as of last
 month. My PC editors had a sorely-missed feature that basically
 enabled the HOME button on my keyboard to intelligently go to the
 real beginning of the line I was on. That is, it would place the
 insertion point after ^\s+ on that line, essentially.

 The problem: I have no idea where to start on this... I have a feeling
 that once I get started in Apple Script for BBEdit, I'm going to be
 making all kinds of handy things, but this feature is the one I miss
 most, so it's my first.

 Anyone have any advice to get me started? Haha. Don't write it for
 me... No fun in that. I'm just not sure how to access the active line,
 or how to move the insertion point. I think from there, I'd be well on
 my way.

 Thanks!

-- 
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: syntax coloring bug

2010-07-13 Thread Kendall Conrad
I usually notice this with the style tag where if the tag has only a
couple line breaks, the end style tag and the rest of the document
stop being colored. It's hard to consistently reproduce and starts
working right once you start adding content. I can see the same
behavior with the script tag.

A common occurrence is typing in,

script type=text/javascript/script

then place the text cursor between the tags and hit enter twice. Most
of the time I'll see the lower part of the document stop being
colored.

-Kendall
BBEdit 9.5 (2740)

On Jul 12, 11:29 am, mmgh marc.her...@artefact.be wrote:
 I experience a syntax coloring bug in version 9.5 wherein a closing /
 script tag causes the rest of the HTML document to be miscolored.
 I thought this was resolved in version 9.0.2

-- 
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: searching!

2010-06-08 Thread Kendall Conrad
How much HTML/CSS do you know? BBEdit is a text editor so you have to
be really comfortable with these in order to use it for web site
editing. The source code on the page looks like it was probably done
by hand.

You get BBEdit from the Bare Bones web site, 
http://www.barebones.com/products/bbedit/
(there's a free trial)
Installing it is the same as any application on Mac. Open the disk
image (DMG) and drag it to the Applications folder. The only issue is
that the latest BBEdit requires 10.5.8 or higher. TextWrangler, which
is a completely free version of BBEdit with fewer features works on
10.4.11 and higher so you'll be able to use it,
http://www.barebones.com/products/textwrangler/ That's where I would
start.

Whether or not it'll get the job done for you depends on your comfort
with a text editor and what you consider to be simple. BBEdit has
plenty of handy features for doing coding and I use it nearly
exclusively for my web development of HTML, CSS, JavaScript, and PHP.

-Kendall


On Jun 8, 9:11 pm, Lynelle Mason lynellema...@comcast.net wrote:
 I am 79 and a writer mainly of  historical fiction for children.  I  
 have recently acquired a web page but want to have a simple(?) way of  
 editing my web site.  bbedit looks promising.  How do I go about  
 getting it, installing it, etc. and most of all will it do the job  
 for me?

 My computer is a Mac OSX 10.4.11 and my web site is  lynellemason.com

 Thank you in advance for helping me.

 Lynelle Mason

-- 
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 Kendall Conrad
Well, for 15 chars from end of line you could use regexp (grep in the
find/replace dialog). Here's a crude example

([\w\W]{15})$

Then replace what's found with: newstuff\1

The \1 is what is captured in the regexp.

-Kendall

On Jun 6, 3:31 pm, LuKreme krem...@kreme.com wrote:
 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

 getting the files to the point where I can then insert the names is not a 
 problem I have processes and searches to do all that, the only issue is not 
 being able to do the column paste because the lines don't line up.  Since I 
 am moving to a standard filenaming convention, the RIGHT side (the target 
 name) is always going to be the same length (up until I paste in the names) 
 so if there was some way to right justify all the lines quickly or to do a 
 column insert at '15 characters from end of line that would sort me out. Or 
 is there something else I am missing?

 (SOMETIMES I can use prefix/postfix lines, but often that is not so easy)

 --
 I hope someday you know the indescribable joy of having children, and
 of paying someone else to raise them.

-- 
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: php default

2010-06-05 Thread Kendall Conrad
In Preferences  Languages  Check box at bottom of right panel will
change the clipping set based on the file type, so if you have the
default language type set for PHP, the clipping set should default to
PHP. At least it should.

-Kendall

On Jun 5, 10:56 am, Ptarmigan thdyo...@gmail.com wrote:
 Thanks for the tips.

 Is there a way to make a php clipping set the default clipping set as
 well ?

 The language setting preference is v nice.

 Ptarmigan

 On Jun 4, 8:16 pm, Gabriel Roth gabe.r...@gmail.com wrote:

   it wld be nice if the default language was php: can i make it so when
   i open a new doc ?

  Go to Preferences  Languages. Select PHP. Click 'Make Default.'

-- 
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: Open Dialog won't open Project file

2010-04-28 Thread Kendall Conrad
Looks like I mistyped actually, my file does have that extension
already (.bbprojectd).

@Harald, thanks for that suggestion, unchecking Show hidden files
worked for me. I guess that makes sense in the event someone wanted to
edit those files inside. Thanks for the help guys.

-Kendall

On Apr 27, 10:42 pm, Rich Siegel sie...@barebones.com wrote:
 On 4/27/10 at 10:38 PM, angelw...@gmail.com (Kendall Conrad) wrote:

 Before the update, I created a project with the .bbproject extension.

 Renaming the project to use the .bbprojectd filename extension
 will probably solve your problem.

 .bbproject was the extension for old-format projects, but a
 folder with that extension isn't recognized as a project,
 whereas .bbprojectd should be.

 Hope this helps,

 R.
 --
 Rich Siegel                                 Bare Bones Software, Inc.

-- 
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: Balance and Fold Question

2010-04-09 Thread Kendall Conrad
A note on sigs, they only apply to the email versions. Some of us only
use this list from the Google Groups web site and use that interface,
which does not show the signature mentioned. I don't believe I've ever
seen the sig as I only use the group site.

-Kendall

On Apr 9, 12:27 pm, Charlie Garrison garri...@zeta.org.au wrote:

 Every message from this list has a signature at the end.


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

To unsubscribe, reply using remove me as the subject.


Re: iPad?

2010-04-06 Thread Kendall Conrad
This has gotten some discussion here already. Essentially, we all want
it, but it's not here as of yet.

http://groups.google.com/group/bbedit/browse_thread/thread/4c0fa5438650e360/2ec3e06e33afb57e

-Kendall



On Apr 5, 11:57 pm, Zee12 allan.abrah...@gmail.com wrote:
 Hi,

 Please make my day and tell me that an iPad version is being
 developed.

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

To unsubscribe, reply using remove me as the subject.


Re: Extracting text from tags

2010-04-04 Thread Kendall Conrad
Working with the text sample you gave the the following seems to work
to give you comma separated email addresses, except for an extra comma
at the end. The find is the same as from the other thread except
doens't have the \r at the end.

find: ([^]+)([^]+)
replace with: \2,

-Kendall


On Apr 4, 6:50 am, maciek.schejbal maciek.schej...@gmail.com
wrote:
 Hi Kendall,

 Yes, I went through the previous post, which worked ok when the source
 was structured such that each entry was separated by a carriage
 return, in this case I have something like this:

 Joh doe j...@act.orgRez Olution r...@mindspring.comAd Ab
 a...@aol.comSeth Ron s...@product.com

 I can't get a grip on grep, so to speak and can't figure out the
 variations. Thank you for clear directions.

 Maciek

 On Apr 3, 8:09 pm, Kendall Conrad angelw...@gmail.com wrote:

  I offered up a solution to a very similar post here in the group.

 http://groups.google.com/group/bbedit/browse_thread/thread/8658d08b55...

  See if you can make use of it.

  -Kendall

  On Apr 3, 9:23 am, maciek.schejbal maciek.schej...@gmail.com
  wrote: Hi,

   I have a list of emails enclosed within  signs preceded and followed
   by a name and/or quotation marks and various characters, with and
   without spaces, carriage returns, basically total mess, except those
   emails inside  and  tags. How can I extract those emails, place them
   in a comma-delimited format and discard everything else?

   Thank you,
   Maciek

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

To unsubscribe, reply using remove me as the subject.


Controlling BBEdit via script other than AppleScript

2010-03-09 Thread Kendall Conrad
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.

-- 
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 Kendall Conrad
That was one of my first thoughts after the event. I was really hoping
the iPad's OS was going to be capable of running Mac apps natively,
but got disappointed. Well, that and no USB port. Being able to use a
program like BBEdit on the iPad would very much increase the
likeliness of me getting one as I would haul it and the nifty keyboard
dock to work with me where I'm forced to use Windows all day and miss
having an awesome text editor like BBEdit.

On Jan 27, 1:55 pm, marimbadog marimba...@gmail.com wrote:
 Let me be the first to ask (at least I think I'm the first). BBEdit
 for the iPad? Would make my life as a web master easier

-- 
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: Using grep for organizing emails

2010-01-17 Thread Kendall Conrad
OK, my original idea should work pretty well for the second format
that you want, just change the replace with to \2. For the comma-
separated addresses on a single line use,

([^]+)([^]+)\r

for the regex, then

\2,

for the replace with. You'll of course need to delete the last command
from the result. That at least worked for me.

-Kendall

On Jan 17, 12:25 am, maciek.schejbal maciek.schej...@gmail.com
wrote:
 Kendall, I would like these lines:

 Joel lkj joe...@gmail.com
 lkj...@gmail.com lkj...@gmail.com
 l...@aol.com
 Mr.Gilbert Llkjlkj lkj...@fasny.org

 to appear like this:

 joe...@gmail.com, lkj...@gmail.com, l...@aol.com, lkj...@fasny.org

 and afterwards like this:

 joe...@gmail.com
 lkj...@gmail.com
 l...@aol.com
 lkj...@fasny.org

 Many thanks,
 Maciek

 On Jan 15, 8:30 pm, Kendall Conrad angelw...@gmail.com wrote:

  It would be helpful to see an example of what you're working with.
  I'll assume it looks something like this,

  john sm...@email.com
  jan d...@other.com

  Grep: ^([^]+)([^]+)$
  Replace with: \1,\2

  That gets pretty close depending on the exact format you have to work
  from, and I'm also not sure what you want to end result to look like.
  If you could provide examples I could give a more precise solution.

  ~angelwatt

  On Jan 15, 1:36 pm, maciek.schejbal maciek.schej...@gmail.com
  wrote:

   Hi,

   I have a list of emails enclosed within  signs preceded by a name,
   usually in two or three word format. I need to extract those emails
   and place them in a comma-delimited document.

   Each entry is on a separate line, followed by the carriage return
   though I'm curious how to perform that extraction without separate
   lines present.

   Thanks for your help,
   Maciek
-- 
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

2010-01-17 Thread Kendall Conrad
This seems to work:

td([\s\S]*?a\s[\s\S]*?)/td

-Kendall

On Jan 17, 2:42 pm, Warren Michelsen wmichel...@gmail.com wrote:
 I need to search for a td/td tag set and everything in between, which may 
 include line breaks but which must include an anchor.

             td
                                     a   href=http://URL.WILL.BE.HERE;Link 
 Text here
                             /td

 I need to find and replace this entire table column. (Replacing with  so as 
 to delete.)

 What's the Grep pattern to find this?
-- 
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: Highlighting a string

2010-01-15 Thread Kendall Conrad
startLine is a built-in in thing, which you can find in the
AppleScript Dictionary for BBEdit. It finds the line where you're
currently selected. You probably don't need the startLine and can just
use selection on its own.

On Jan 15, 1:51 am, jan j...@olb.nl wrote:
 Thanks, It sure helps.
 So I need a startingpoint and selection length. But what about
 startLine?
-- 
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: Highlighting a string

2010-01-14 Thread Kendall Conrad
If it helps, here is some AppleScript I use for one of my scripts that
deals with some selecting of text once I know the indexes.

select (characters stPos through cursorLength of line (startLine of
selection) of front window)

That's inside a tell BBEdit type section.


On Jan 14, 7:28 pm, jan j...@olb.nl wrote:
 I love the balance command in BBEdit and would like to have the same
 functionality within strings. By a string I mean anything that is
 surrounded by quotes (\' or \).

 So given my cursor position I would like to select the entire string
 around it just like the balance command does. It makes it easy to copy
 strings to other documents.

 I tried some Applescript stuff with a forward and backward search but
 got stuck in the actual selecting within BBEdit. Any -preferable
 elegant- ideas?
-- 
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: Trying to edit a webpage

2009-12-30 Thread Kendall Conrad
Do you have access to the file? As in, do you have FTP access to the
site where the file is? Once you have access to the file, it's a
simple matter of opening the file in BBEdit and making the edits. Not
sure where your problem is. Not even sure if you're trying to use
BBEdit or DreamWeaver to accomplish this.

On Dec 29, 11:43 am, nuevomex nuevo...@mac.com wrote:
 I need to edit a paragraph in a webpage, specifically alter some text
 and add a link. The original webpage was done in Dreamweaver. I seem
 to have a lost a step between 'preview' and seeing the final edits on
 the web. Obviously, I am TOTALLY new to this. I just want to make this
 little change and then I PROMISE I won't do anything more. ;) (well,
 not till I know it better) Thanks for any help. Susie

-- 
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: Zen Coding: A Speedy Way To Write HTML/CSS Code

2009-12-17 Thread Kendall Conrad
I did see your script and had tried it out. One big advantage my
script brings is that it can wrap selected text with an abbreviation.
Yours doesn't seem to be able to handle that. Also, my script inserts
the expanded text as a Clipping and makes use of the placeholders so
you can tab to the next edit point as you do with the clippings BBEdit
comes with. You can download my scripts and give them a try. All the
source code is with them too so you can see what I'm up to.


On Dec 17, 8:20 pm, Charlie Garrison garri...@zeta.org.au wrote:
 Good afternoon,

 Did you see the script I sent to this list a few weeks back? The
 script I supplied already works without requiring an AppleScript
 dialog. Just select the abbreviation and run the zencoding
 script (via key shortcut).

 What was not working was the auto-complete behaviour; script
 requires text to be selected rather than just looking for 'word'
 that is before the insertion point. I asked for some support
 from any list memeber to help with just the auto-complete
 behaviour, and the script would be functionally complete.

 So, is your script doing something that mine is not doing? Or is
 it just a duplication of effort? There is no point in there
 being two functionally equivalent scripts; it will just muddy
 the waters for BBEdit users. We should merge our efforts.

 Charlie

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