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
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
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
ry 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
> > diffe
& 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
&
. 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 C
ow 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 runnin
rror 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
> > beli
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
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
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
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
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
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
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
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
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
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
: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
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,
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
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
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
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
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
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
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.
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
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
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
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:
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
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
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
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,
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
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
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
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
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
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
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
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
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
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
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
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,
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
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
, 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
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
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?
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
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
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:
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
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
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
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
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
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
- 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
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
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
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
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
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.
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,
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
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:
, 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
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
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
...@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
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
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
...@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
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
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
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
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
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
82 matches
Mail list logo