Re: New windows when starting BBEdit

2024-03-21 Thread Fletcher Sandbeck
it to test. [fletcher] > On Mar 21, 2024, at 8:35 AM, Fletcher Sandbeck wrote: > > There's a preference in the Application settings to "Reopen documents that > were open on last quit" which you could toggle off but it's a great feature > so you probably w

Re: New windows when starting BBEdit

2024-03-21 Thread Fletcher Sandbeck
There's a preference in the Application settings to "Reopen documents that were open on last quit" which you could toggle off but it's a great feature so you probably want it on. I tested toggling it off and then back on again and it cleared out the test documents I left open. If that doesn't

Re: AppleScript to compare two frontmost documents

2024-03-20 Thread Fletcher Sandbeck
You can get the "first text document", "second text document", etc. so a command like this will compare the front two windows. tell application "BBEdit" activate compare first text document against second text document options {ignore RCS keywords:true, ignore all spaces:true} end tell

Re: Bbedit Applescript command

2023-08-16 Thread Fletcher Sandbeck
System Events can change some metadata. After giving the appropriate permissions, this works to set a file to open with TextEdit rather than BBedit. tell application "System Events" set default application of file "/Users/fletcher/Desktop/myfile.txt" to file

Re: Change random uppercase words to lower case

2023-06-13 Thread Fletcher Sandbeck
- that's a big improvement! > It will help me a lot. > Is there a way to avoid it finding single capitals - like "I" (capital i) or > "A"? > Andy > On Tuesday, 13 June 2023 at 17:45:02 UTC+1 Fletcher Sandbeck wrote: >> You could try modifying it like this.

Re: Change random uppercase words to lower case

2023-06-13 Thread Fletcher Sandbeck
You could try modifying it like this. Changing \b to (?<=\b) makes it so the match starts at a word boundary but does not include the word boundary in the match. With the corresponding change to (?=\b) at the end of the pattern this prevents the spaces being part of the match so should prevent

Re: How to remove timing string?

2023-05-30 Thread Fletcher Sandbeck
The Pattern Playground on the Search menu is a great way to build up a pattern for search/replace. You can see interactively what it is going to match as you create it. I think this pattern works. Search: ^[0-9:, -->]+\r Replace: The caret sign anchors the search at the start of the line. The

Re: Use Keyboard Maestro (KM) to Automate BBEdit Menu Steps

2023-05-22 Thread Fletcher Sandbeck
If you add the text factory as a Text Filter then you can assign it a keyboard shortcut. Put it in ~/Library/Application Support/BBEdit/Text Filters/ and then you can run it from the Text > Text Filters menu or assign a keyboard shortcut in Settings... on the Menus & Shortcuts tab. h/t

Re: Find and Replace items which do NOT contain a simple pattern...

2023-05-14 Thread Fletcher Sandbeck
\d{1,3} matches a sequence of 1 to 3 digits so it will match 1, 12, or 123. If you specify a single number in the braces then it will match only that number of digits. \d{3} will match 123, 231, etc. If you want to match all numbers longer than three digits you can use \d{3,}. This will match

Re: Digest for bbedit@googlegroups.com - 3 updates in 1 topic

2023-05-04 Thread Fletcher Sandbeck
likely.) >>> >>> David W. >>> da...@weinberger.org <mailto:da...@weinberger.org> >>> [home page <https://weinberger.org/>] [writings >>> <https://www.weinberger.org/writings/index.html>] [Everyday Chaos >>> <https://everydaychaosbook.c

Re: Digest for bbedit@googlegroups.com - 2 updates in 1 topic

2023-05-03 Thread Fletcher Sandbeck
FWIW, I've always thought the Project listing was alphabetical. It certainly appears that way in the projects I use. Come to think of it I can't even drag items into a different order... However, if I add a "Collection" to the sidebar in the project then the files within that collection can be

Re: Capturing multiple variables in regular expression

2023-03-22 Thread Fletcher Sandbeck
I'd check for "Gremlins" if you haven't already. In any case that step could be cleaned up a little. The version below doesn't rely on the return at the start of the file and doesn't really care about how the name/number part of the line is formatted. Find: (\r|^)(.+?)\r\t(.+?)\r\t\t Replace:

Re: Capturing multiple variables in regular expression

2023-03-22 Thread Fletcher Sandbeck
I feel like this would be easier with a script of some sort. Nevertheless the idea I had was to do the following. First, use Shift Right to push all the data in two tab stops. And make sure there's an empty line at the start and end of the file. ART 215-2D Art II, Honors

Re: Eliminate Chinese Text

2023-03-21 Thread Fletcher Sandbeck
You can find a Unicode characters using \x{} and then use that pattern to build up a range. The following pattern finds all characters that are not within the range of Latin characters with most common extensions and punctuation. You can tighten or loosen based on the ranges listed here

Re: Text filter deletes source file content

2023-02-04 Thread Fletcher Sandbeck
The text filter replaces the content of the BBEdit document with the output of the script which is empty. You can put the same script in the Scripts folder and run it from there without this happening. You need to add a #!/bin/sh or similar line to the top. You could also probably just echo

Re: Grep help - removing text within a tag

2022-10-10 Thread Fletcher Sandbeck
The find pattern would be "" with "Grep" checked. You can use the Multi-File Search... dialog to run this against a folder containing your .txt files to see how many matches there are. When I'm doing multi-file work like this I'll usually start out doing a Find All in the multi-file dialog and

Re: Best way to rewrap text?

2022-07-12 Thread Fletcher Sandbeck
There's a "Hard Wrap" command on the Text menu which can do this. I have it assigned to shortcut Command-\ which brings up the dialog and Command-Option-\ which applies using the last settings. I think these are the default shortcuts but I'm not sure. You can change the shortcut in the "Menus &

Re: Linkage

2022-05-13 Thread Fletcher Sandbeck
You can use a tool like Site Sucker to spider a site and download all the files that are linked from the main access access points. For example, you could find out all of the pages there are linked from the home page. You should also consider that some pages might not be linked but are still

Re: Executing Multiple Saved Regular Expressions

2022-01-05 Thread Fletcher Sandbeck
You can do this with a Text Factory. Create one from the File > New menu and then add your search/replace operations using several Replace All actions. Use the Choose button to select the open text window you want to do the replacements in and then hit the Play button. [fletcher] > On Jan 5,

Re: Need easy way to make first letter of each line upper case

2021-10-28 Thread Fletcher Sandbeck
Find "^(.)" and replace with "\U\1". Make sure Grep is checked in the find/replace dialog. The ^ matches the start of a line so the . matches the first character, surrounded by parentheses so we can refer to it in the replacement pattern. The replacement uses \U to make it uppercase.

Re: Change background for Notes

2021-09-21 Thread Fletcher Sandbeck
It looks like Notes default to markdown format. If you don't use markdown much for other files you can add a custom color scheme in the Languages preferences by adding Markdown to the Language-specific settings at the bottom. [fletcher] > On Aug 27, 2021, at 6:11 PM, Mark Hurty > wrote: >

Re: How to move #tags up to line above and sort doc by tags?

2021-08-19 Thread Fletcher Sandbeck
If the tags always start with hash marks then you can find "\s+#" and replace with " #". Basically you're just replacing whatever white space appears before each # with a single space. For sorting you can look at Sort Lines... on the Edit menu. Sort with a pattern like "#.+" with Entire Match

Re: bbresults

2021-03-29 Thread Fletcher Sandbeck
I think the -n flag is critical on the grep command for this to work. grep -n win_template *.yml | bbresults -p grep [fletcher] > On Mar 29, 2021, at 8:34 AM, Daniel Palmer wrote: > > I am working on adding an Ansible-lint script to bbedit for my coding. I > seem to be having an issue with

Re: Canonize multiple files

2021-02-22 Thread Fletcher Sandbeck
You can use a Text Factory for this. Choose File > New > Text Factory and set the first action to Canonize and set any options you need. Then choose what files to run it on. As always, be careful running batch operations like this. It's best to always have a backup or be working with source

Re: How convert non-latin letters to browser friendly ones ( Ä ö ü å)

2021-02-14 Thread Fletcher Sandbeck
I think Markup > Utilities > Translate Text to HTML... will do what you're looking for. Unicode support is widespread at this point. It's better to ensure that your workflow is UTF-8 compliant so that you don't need to bother with encoding common characters.

Re: Wrap tag around URLs

2021-02-04 Thread Fletcher Sandbeck
You can use Find/Replace to do this. Open the Find dialog from the Search menu, check the "grep" box at the bottom which allows you to use regular expressions, and use these patterns to start. The first find https:// followed by the characters that are commonly found in URLs. The second

Re: Cleaning the Scratchpad

2021-01-13 Thread Fletcher Sandbeck
You can have BBEdit run a script by creating a folder ~/Library/Application Support/BBEdit/Shutdown Items and then adding an AppleScript like this to it. Open Script Editor, paste this in, and then save it to the Shutdown Items folder as a .scpt file. tell application "BBEdit" set the

Re: Counting occurrences of names

2020-10-06 Thread Fletcher Sandbeck
I'd do this in two steps. First, isolate all the names using a search/replace with the following pattern with "Grep" turned on. Use the "Extract" button to create a new file. Pattern: ^.*From (.*?) :.*$ Replace: \1 That gives you a file with just the names in it on separate lines. Harvey

Re: Color scheme vs. color space question

2020-10-02 Thread Fletcher Sandbeck
These could be the effects of the Display Profile chosen in the display system preferences, automatically brightness adjustment, Night Shift, or sub-pixel rendering or anti-aliasing. [fletcher] > On Oct 2, 2020, at 7:28 AM, François Schiettecatte > wrote: > > Sorry have been clearer. > >

Re: Invoking a terminal command in Terminal.app from a Worksheet

2020-06-20 Thread Fletcher Sandbeck
You can execute a command in the terminal with Applescript like this: tell application "Terminal" do script "echo foo" end tell You can execute an AppleScript in the terminal with osascript. You include each line of the script as a separate -e parameter. Putting those together this runs

Re: Help for search & replace with Grep

2020-06-12 Thread Fletcher Sandbeck
Also, check out the Pattern Playground on the Search menu. Being able to see what BBEdit is matching as you change the search pattern really helps narrow in on how to make it work for your actual data. [fletcher] > On Jun 12, 2020, at 7:37 AM, Jean-Christophe Helary > wrote: > > > >> On

Re: Alpha Channel

2020-06-10 Thread Fletcher Sandbeck
This seems to be EOLed but it's possible to add new panels to the built-in color picker. This one, Skala, has a few alpha channel options. It seems to work okay even though they've ended support for it. https://bjango.com/mac/skalacolor/ Hope this helps,

Re: Find & Replace just once vs. all

2020-05-27 Thread Fletcher Sandbeck
You can tailor your regular expression to only find one match. I use [\s\S]* to defeat the tendency of .* to match only within a single line. replace "([\\s\\S]*?)find string([\\s\\S]*)" using "\\1replace string\\2" searching in text 1 of project window 1 options {search mode:grep, starting at

Re: Insert/replace text after a known paragrapher.

2020-05-21 Thread Fletcher Sandbeck
Something like this should do the trick. The expression in the first set parentheses finds the paragraphs you are targeting. The start of a line ^ followed by your target text and everything up to the next new-line \n. The expression in the second set of parentheses finds the following

Re: Grep to reformat screenplay dialogue into novel form?

2020-05-10 Thread Fletcher Sandbeck
The basic idea is to define your search pattern with parentheses around the parts you want to use in the replacement. We might find the character name in all caps, two returns, and then the dialogue. You might need to add more \r return characters to match your source. Search: ([A-Z

Re: RegEx pattern find something but replace on following

2020-04-12 Thread Fletcher Sandbeck
This seems to do the trick but you have to run Replace All multiple times for it work. The look-behind assertion selection selects only lines which don't start with >. Then we find any sequence of zero or more valid characters followed by a single U and replace it by T. This replaces the first

Re: Capture group question

2020-03-06 Thread Fletcher Sandbeck
There's a good discussion at the following URL but it occurs because the regular expression is evaluated as a state machine. Here the capturing group itself is repeated by the {2}. The first match is discarded when it sees the second match and that's what you see in the results.

Re: Changing a lower case letter of the first word to uppercase letter of the first word in a sentence

2020-03-05 Thread Fletcher Sandbeck
This seems to work. It's a little tricky to be sure you're at the start of a sentence so I'd advice cycling through the matches rather than doing a global replace. Search pattern: (?:^|\. +)[a-z] Replace pattern: \L\0 Use with grep and case sensitive turned on. The search pattern finds either

Re: Saving a search pattern in Pattern Playground

2020-03-05 Thread Fletcher Sandbeck
The "g" menu at the top allows you to save and recall search patterns. [fletcher] > On Mar 4, 2020, at 5:25 PM, Howard wrote: > > How can I save a search pattern in Pattern Playground? > > -- > This is the BBEdit Talk public discussion group. If you have a feature > request or need

Re: Capture group question

2020-03-01 Thread Fletcher Sandbeck
I think the problem is that the {2} calling for a repetition of the previous pattern is outside the parentheses which signal the capture. You can use a non-capturing group (?: ) to group patterns without creating another capture. And then wrap the entire new expression with the repetition in

Re: Copying a search pattern to a new document

2020-02-27 Thread Fletcher Sandbeck
Use the "Extract" button in the Find dialog box. Make sure this is no Replace pattern specified and it will put the entire found pattern into a new document. [fletcher] > On Feb 27, 2020, at 5:31 AM, Mohannad Mahmoud > wrote: > > Hello to all, > > I am trying to copy a search pattern to a

Re: Selecting the last word of a line

2020-02-03 Thread Fletcher Sandbeck
Open the Find dialog and enter the following patterns and do a replace all. This finds one or more non-whitespace characters \S+ at the end of a line $ and replaces them with a tab \t and the found text \1. Find: (\S+)$ Replace: \t\1 Also the following variant replaces the white space \s+ in

Re: GREP question

2019-12-19 Thread Fletcher Sandbeck
You can think of the pattern as a state machine. It scans forward in the input until the first match in the pattern. In this case the first match is the first "a" in the input so that's where the match starts. The rest of the pattern tells it how far to extend the match, through the next "b".

Re: GREP question

2019-12-19 Thread Fletcher Sandbeck
The question mark after the + makes it non-greedy so it won't match the character immediately following. However, in this case you're matching until the end of the line so I don't think it does anything. Compare these two patterns matched against the input. The ? after the + prevents the match

Re: Problem with "Preview in BBEdit"

2019-10-18 Thread Fletcher Sandbeck
Protocol relative URLs, starting with // but not specifying http or https, e.g. //www.example.com/asset.jp g, are useful on a site that is served through both HTTP and HTTPS to ensure that assets are loaded using the same protocol. I can't find a clear W3C

Re: longer search history ?

2019-08-29 Thread Fletcher Sandbeck
Search for BBEdit Expert Preferences in the manual for some additional settings which you can adjust in the terminal like: By default, BBEdit will remember the 16 most recent search and replace strings/patterns for the popup menu in the Find and Multi-File Search windows. The size of this

Re: Opt-Delete Doesn't Delete Whitespace Before Word?

2019-07-05 Thread Fletcher Sandbeck
I think the BBEdit behavior makes sense if you're working with indented code. It allows you to delete the indent without deleting the last word on the previous line. BBEdit also has a different notion of which characters break words. Try option-deleting through code like this in BBEdit and

Re: Close multiple files without saving

2019-03-12 Thread Fletcher Sandbeck
Close All Documents, Cmd-Option-W, brings up a single dialog listing all the documents so you can select which to save or none. Hold down Option when you hit the window close box and it seems to do the same thing. Close All Windows, Cmd-Option-Shift-W, is similar but seems to ask about each

Re: Find and Replace, one-by-one, Multi-file

2019-02-17 Thread Fletcher Sandbeck
I do this sort of thing fairly often updating old syntax or cloning a site. I like to see every replacement unless I'm doing something really trivial. If there is something you find yourself replacing often you can add an identifier so you can do a global search/replace without as much worry.

Re: Finding the beginning/end of lines

2018-11-18 Thread Fletcher Sandbeck
I see the same thing. It seems like a bug so you might want to contact support at supp...@barebones.com. A workaround would be to search for \r. [fletcher] > On Nov 18, 2018, at 9:02 AM, B. Williams wrote: > > New BBEdit user here using 12.5. I'm running into issues using the 'find' >

Re: grep for odd number of single quotes in a line?

2018-09-27 Thread Fletcher Sandbeck
It isn't a complete solution, but if you search for \w'\w those will tend to the be apostrophes since paired quotes usually begin or end a word. [fletcher] > On Sep 27, 2018, at 4:14 AM, Thomas Green wrote: > > I need to find all lines that contain an odd number of single straight > quotes,

Re: grep for files that don't have a pattern?

2018-08-07 Thread Fletcher Sandbeck
In the Multi-File Search dialog box there is an "Exclude Matches" option when you click on the "Options..." button in the bottom half of the dialog box. [fletcher] > On Aug 7, 2018, at 6:13 PM, Barbara Snyder wrote: > > Is there a way to use grep to find all files that do not contain a

Re: Markdown Links

2018-07-31 Thread Fletcher Sandbeck
You can select any text and choose File > Open Selection (Command-D) to interpret it as a relative file path and attempt to open it. I don't think it's language dependent. If you have a Project or Site defined it will use the settings to help find the file. If it can't interpret the path it

Re: Preview phone/ipad size?

2018-06-17 Thread Fletcher Sandbeck
It is good to run an Analytics or comparable report to see what screen sizes your users have. I'm still seeing iPhone 5 class screens running about 8% of our audience which is enough that we still want to support them. Which isn't to say your audience is going to the be the same, but it's good

Re: HTML mode confusion

2018-05-05 Thread Fletcher Sandbeck
I think the crux of the issue is that most HTML tags are going to contain nested, formatted HTML. If you edit the tag do you expect to see all of your document in the dialog box? It opens up a whole can of worms. You could include it for "simple" tags, but even anchor tags may contain images

Re: Multiple replace of highlighted text

2018-05-04 Thread Fletcher Sandbeck
One thing I find useful is to set a shortcut for "Replace and Find Next". I use "Cmd-Opt-F" which is normally "Live Search" I guess. I use Cmd-E and Cmd-Opt-E as described to set up a search/replace and then cycle through the document doing Cmd-G to advance to the next instance and either

Re: Multiple Find and Replace at once

2018-04-10 Thread Fletcher Sandbeck
You should be able to put in a new line using \n. replace "~NM1*87*2~N3*" using "\nBILLING ADDRESS: " searching in text 1 of front text document options {starting at top:true} [fletcher] > On Apr 10, 2018, at 1:06 PM, Mike W wrote: > > I've never used Scrip editor.

Re: Multiple Find and Replace at once

2018-04-10 Thread Fletcher Sandbeck
If there are a lot of replacements it might be easier to do a script. Open Script Editor and create a script like this with all your find/replace operations. This conducts its operations in the frontmost window. tell application "BBEdit" activate replace "~NM1*87*2~N3*" using "↵ BILLING

Re: grep help coordinates

2018-03-05 Thread Fletcher Sandbeck
Something like this should do it. The unescaped parentheses define groups which are referred to by \1 and \2 in the replacement pattern. The escaped parentheses match the actual parentheses around the coordinates. Find: \(([0-9.-]+), ([0-9.-]+)\) Replace: \2,\1 Hope this helps, [fletcher] >

Re: Wildcard on search/replace

2018-01-30 Thread Fletcher Sandbeck
I would add to look at the "Grep Reference" in BBEdit Help for documentation of the syntax. Grep is like wildcards on steroids. [fletcher] > On Jan 30, 2018, at 6:31 AM, Kerri Hicks wrote: > > Well, it depends on what you want to do to those elements. But here's an >

Re: Help with a grep question

2018-01-27 Thread Fletcher Sandbeck
Select "Process Lines Containing" from the Text menu. Use an expression like "ID_User" and the "Copy to new document" option. This will create a new document that contains only lines that you want to process. Then a simple replace all should do the actual work. Find: .*ID_User=(.+?)&.*\r

Re: Reload from Disk

2018-01-25 Thread Fletcher Sandbeck
Usually the record button in the Script Editor will reveal at least the basic shape of the commands related to a menu option, but it doesn't return anything for "Reload from Disk". This code does the equivalent closing without saving and then re-opening the frontmost document. tell

Re: Text filter question

2018-01-13 Thread Fletcher Sandbeck
It looks like JSHint requires a dash to indicate that it should read content from standard input. Many CLI tools read from stdin by default when they don't see a file name specified, but others require - or another parameter to trigger this behavior. #!/bin/bash jshint -

Re: regular expression replacement with math expressions

2017-11-06 Thread Fletcher Sandbeck
Some programming languages allow you to specify a function as the replacement expression. For example you an do this in JavaScript like this. "1 and a 2".replace(/\d/g, function (match, capture) { return (parseInt(match)+1); }); Outputs: "2 and a 3" In terms of BBEdit you would probably

Re: Auto-select search selected when text is selected

2017-09-02 Thread Fletcher Sandbeck
You can toggle that setting using a key shortcut, Ctrl-Shift-s. You can see all the shortcuts for the Find Windows shortcuts in the Menus & Shortcuts preferences. Or, switch them to something easier. [fletcher] > On Sep 1, 2017, at 7:41 PM, vr...@sbcglobal.net wrote: > > Is there a way to

Re: Global Keyboard Shortcut for BBEdit Scratchpad?

2017-09-01 Thread Fletcher Sandbeck
You can do this with an Automator Service and the global Keyboard Shortcuts system preferences. Check out the Stack Exchange article below. https://apple.stackexchange.com/questions/175215/how-do-i-assign-a-keyboard-shortcut-to-an-applescript-i-wrote Open Automator and create a new Service. Set

Re: Is there a keyboard shortcut to toggle Soft Wrapping?

2017-08-11 Thread Fletcher Sandbeck
You can assign one. Open Preferences and select Menus & Shortcuts. Find "Status Bar" in the list and you'll find "Soft Wrap Text" within the "Text Options" and can assign a shortcut there. [fletcher] > On Aug 11, 2017, at 8:44 AM, F. Alfredo Rego wrote: > > Is there

Re: compare docx files?

2017-07-26 Thread Fletcher Sandbeck
If you open the Find Differences window you can drag two documents from the Finder into the rounded rectangle targets on the right. [fletcher] > On Jul 26, 2017, at 4:05 PM, Ken G. Brown wrote: > > macOS 10.12.6 > > I’m trying to use BBedit 11.6.7 (397078) (06/15/2017) to

Re: How to backspace over only one space?

2017-06-14 Thread Fletcher Sandbeck
Ugh, yeah, you're right. I was focused on the problem at hand, but changing that setting like that would be pretty irritating in the long run. [fletcher] > On Jun 14, 2017, at 12:47 PM, Rich Siegel <sie...@barebones.com> wrote: > > On Wednesday, June 14, 2017, Fletcher

Re: How to backspace over only one space?

2017-06-14 Thread Fletcher Sandbeck
It seems like BBEdit will delete spaces in multiples defined by the "Tab width" setting in the Editor Defaults section of the Preferences. If you set this to 1 then it will backspace like you want. [fletcher] > On Jun 12, 2017, at 11:02 AM, Walter Ian Kaye wrote: > > If

Re: New Window extends under Dock

2017-05-12 Thread Fletcher Sandbeck
You can position a new window where you want it and then choose Save Default Text Window on the Window menu. New windows should appear there from now on. Also, Option-Click on the green window button will right-size it so it isn't under the dock. Simply clicking the green window button will go

Re: [] or | ?

2017-05-09 Thread Fletcher Sandbeck
I would hazard in general that there are going to be a significant number of isomorphic regular expressions. Searching for whether anyone has looked into this, I found this exchange where the same question you pose is discussed.

Re: How to configure syntax colouring?

2017-04-27 Thread Fletcher Sandbeck
BBEdit normally determines the language of files you open based on the file extension and applies appropriate syntax color. You can see what language it has determined by looking at the pop-up in the footer of the window. Or, select a language manually if you are working on a new file or a file

Re: trimming + grep + applescript

2017-04-15 Thread Fletcher Sandbeck
I'm not sure whether BBEdit's find/replace can be used in that way. The commands normally trigger the find/replace to occur within the specified open text document. This command removes all the white space from the beginnings of lines in the frontmost document. tell application "BBEdit"

Re: Apply mods to Selected Text Only

2017-04-06 Thread Fletcher Sandbeck
Actually, re-reading your post, I think the clipping you are looking for is this: echo "#SELECT#" >> $target [fletcher] > On Apr 6, 2017, at 3:52 PM, Fletcher Sandbeck <fletc...@cumuli.com> wrote: > > This sounds like a job for Clippings which you can fi

Re: Apply mods to Selected Text Only

2017-04-06 Thread Fletcher Sandbeck
This sounds like a job for Clippings which you can find in the Clippings "C" menu or in Windows > Palettes. You can define a clipping by creating a pattern with #SELECT# in place of where you want the current selection to go. If I understand what you're looking for your clipping would like

Re: Fix duplicate divs caused by old Adobe GoLive bug?

2017-02-21 Thread Fletcher Sandbeck
The trick is to figure out what the problems are and then apply those fixes to all your pages using BBEdit's multi-file search/replace. However, finding the errors is easier than fixing them. This pattern "\s*

Re: Fix duplicate divs caused by old Adobe GoLive bug?

2017-02-21 Thread Fletcher Sandbeck
I've worked on converting some large sites to AMP and it has been good for the HTML quality on the sites. My sites are generally dynamic, but contain user submitted articles and comments so it's been a two step process. Ensuring that the template and navigation of the site is AMP-friendly. And

Re: Regex to find blank lines and lines with only spaces

2017-01-12 Thread Fletcher Sandbeck
I think it does what you're expecting if you change the pattern so the whitespace match isn't greedy: ^\s*?$ \s matches returns and newlines so your pattern ^\s*$ should match any block of lines which contain only whitespace. With the non-greedy modifier it instead stops at the first

Re: Efficiently switching between search patterns

2017-01-11 Thread Fletcher Sandbeck
You can create individual script files in the Scripts menu and assign them key equivalents. Using Script Editor save this simple script into the user Library/Application Support/BBEdit/Scripts folder and then open Preferences > Menus & Shortcuts in BBEdit and you can assign it a shortcut. This

Re: Copy Named Symbol

2017-01-08 Thread Fletcher Sandbeck
There is a pop-up which displays the named symbols in the upper right of each window. You could split the pane using the handle at the top of the scrollbar so you always have the command you are editing in view. Use the pop-up to navigate from symbol to symbol and copy the names into the other

Re: Use BBEdit to update several hundred rows in a 3 column table?

2016-12-19 Thread Fletcher Sandbeck
It might be easier to put your PHP code in a cell in the Excel spreadsheet. Define a new column with "" as its value and export it so your table contains that code from the outset. [fletcher] > On Dec 19, 2016, at 10:49 AM, Peter White wrote: > > Hi Chris, > > Sorry

Re: Coty text into multiple files

2016-11-30 Thread Fletcher Sandbeck
You can do a search/replace in multiple files if you can condense what you need to do into a regular expression. Look at Multi-File Search... on the Search menu. First make the search/replace work on one file. Then, switch to multi-file search and select the files you want to apply it to in the

Re: grep lower case upper case sequence manipulation

2016-11-23 Thread Fletcher Sandbeck
The pattern should work fine, but make sure that you check the "Case Sensitive" checkbox in the Find/Replace dialog box. By default BBEdit ignores case sensitivity so [a-z] will match letters of any case. You can add [0-9] to the second part of your pattern to add a space before the years.

Re: Best tool to open & search large log files (5GB+)

2016-11-17 Thread Fletcher Sandbeck
The size of the log files is why there are specialty programs to summarize and analyze them. However, I usually use a combination of CLI tools and BBEdit to pull out the information that I want. Some of the CLI tools seem more efficient than loading the file into BBEdit and using its tools to

Re: Just bought BBEdit. Previously used TextWrangler. Did I get ripped?

2016-07-28 Thread Fletcher Sandbeck
The features which differentiate BBEdit primarily seem to have to do with HTML coding, automation, scripting, integration with source control, and project management. They mostly benefit those who spend all day programming, have need to automate repetitive data mangling, or who work with teams

Re: Modify all instances of selection a la columnar selection

2016-07-13 Thread Fletcher Sandbeck
The menu shortcuts make replacements like this pretty fast. Select the text you need to change, Command-E to set the find pattern, replace the text and re-select it, Command-Option-E to set the replacement pattern, and then Command-Option-= to replace all. I think those are all standard

Re: Sort email addresses by domain name...

2016-07-06 Thread Fletcher Sandbeck
Choose Sort Lines... from the Text menu and check the Sort by Pattern option with the following Searching Pattern and the Entire Match sub-option. @.* Hope this helps, [fletcher] > On Jul 6, 2016, at 8:53 AM, DrBoBo wrote: > > How does one sort email addresses by domain

Re: How do I access the word-suggestion feature seen in Sep 12, 2011 BBEdit YouTube video?

2016-03-04 Thread Fletcher Sandbeck
In Preferences look at the Editing pane. Make sure "Include dictionary words in completion list" is checked. Then you can run the Complete command from the edit menu to see the list of completions for the current word. I think the default shortcut is F5, but you could change this on the Menus

Re: BBEdit Text filter for Tidying up PL/SQL

2016-02-25 Thread Fletcher Sandbeck
I think we need more specifics to be able to provide an answer. Can you provide an example of the code you are trying to clean up and what it might look like after formatting? [fletcher] > On Feb 25, 2016, at 12:04 PM, Sunny997 wrote: > > Hi, > > Is there a text

Re: Replace leading 4x[space]s with 1x[tab] (each!)

2016-02-25 Thread Fletcher Sandbeck
The simpler answer is to use the Text > Entab... command. This will generally 
do the replace you want although it doesn't strictly follow the replace spaces 
only at the start of a line rule. The Text > Detab... command will replace tabs 
with spaces.

You can do this with a regular 

Git Difference Script

2016-01-19 Thread Fletcher Sandbeck
When doing git merges I end up with automatically generated git difference files that have changes marked with <<< === >>>. These can be a pain to work through and what I really want is to back them out into BBEdit's compare files tool so I can see the changes. I wrote this quick

Re: Edit all selected (?)

2015-12-07 Thread Fletcher Sandbeck
I do this more times a day than I can count. Select text to replace, Cmd-E to use selection for find. Edit the text and re-select it. Cmd-Opt-E to use selection for replace. And then Cmd-G for find next to see if there's another instance in the document. I'll do this pretty much any time I'm

Re: adding other doc types to the ones suggested for Open With...

2015-11-06 Thread Fletcher Sandbeck
I think the services are just listed at the bottom of the context menu right above "Reveal In Finder". I see "Open i BBEdit" down there on every file, but if I select an audio file I also see the service "Encode Selected Audio Files". You can control what services are available in the Keyboard

Re: Two side-by-side documents in full-screen mode?

2015-10-28 Thread Fletcher Sandbeck
If you compare two documents you can full screen that interface. [fletcher] > On Oct 27, 2015, at 5:15 PM, TJ Luoma wrote: > > > Is there a way to see two BBEdit documents side-by-side in full-screen mode > in El Capitan? > > I'm using a 12" retina MacBook so screen space

Re: Need help with AppleScript that converts a selected string of words to "Title Case"

2015-10-20 Thread Fletcher Sandbeck
I found a regular expression online and adapted it for BBEdit. If you replace the else conditional of your script with this it seems to work. tell application "BBEdit" tell window 1 if (selection as text) is "" then set cursorPoint to characterOffset of selection find "\\b\\w"

Re: Removing Text Between Two items (Inclusive) across Multiple Lines

2015-09-10 Thread Fletcher Sandbeck
The problem is that .* generally doesn't match across lines, but you can replace it with a pattern like [\s\S]* to get a multi-line pattern. [\s\S]*? That should match the header no matter how many lines long it is. [fletcher] > On Sep 10, 2015, at 9:37 AM, J Hall wrote:

Re: HTML includes á la Hammer in BBEdit?

2015-06-25 Thread Fletcher Sandbeck
On Jun 25, 2015, at 12:24 PM, Vlad Ghitulescu v...@ghitulescu.de wrote: Am 25.06.2015 um 21:19 schrieb Fletcher Sandbeck fletc...@cumuli.com: I might be misreading what you're looking for though. Yes, I wanted for static sites, before publishing. Take a look at Appendix C Placeholders

Re: HTML includes á la Hammer in BBEdit?

2015-06-25 Thread Fletcher Sandbeck
I might be misreading what you're looking for though. Take a look at Appendix C Placeholders and Include Files of the User Manual (available from the Help menu). [fletcher] On Jun 25, 2015, at 12:12 PM, Fletcher Sandbeck fletc...@cumuli.com wrote: BBEdit can't do anything live

Re: HTML includes á la Hammer in BBEdit?

2015-06-25 Thread Fletcher Sandbeck
BBEdit can't do anything live on the server. It only allows you to edit the files which are served there. But, every web server should have a server-side include option either built-in or available through a more targeted module than PHP. Apache -

  1   2   >