Re: Sorting multiple records in a text file

2024-11-04 Thread jj
Hi Howard, You could do that with a canonize file and a few regular espressions. 1. Create a new file named canonize_lines_to_columns.txt with this content: # -*- x-bbedit-canon-case-sensitive: 1; x-bbedit-canon-match-words: 0; x-bbedit-canon-grep: 1; -*- # End: # Local Variables: # coding: ut

Re: Trying to get Python LSP working

2024-10-24 Thread jj
Hi Chris, For a Python LSP server, you might take a look at ruff: https://github.com/astral-sh/ruff You can install it with homebrew in the terminal : $ brew install ruff or with cargo if rust is installed on your system: $ cargo install ruff Check it was correctly in

Re: Font panel - how to remove a font from the Favorites section?

2024-10-14 Thread jj
Just drag the font out of the window. HTH, Jean Jourdain On Monday, October 14, 2024 at 9:55:30 AM UTC+2 Martin Post wrote: > > See subject. :) I can easily add fonts to that section, I just can't > figure out how to remove them. There's no entry in the panel drop-down > (only “Add to Favorit

Re: Multi-file search File filter not restricting search as expected

2024-10-03 Thread jj
Sometimes software gains wisdom beyond the intentions of its designers. As far as I can tell in my copy of BBEdit, both forms "[Name extension] [is] [adoc]" and "[Name extension] [is] [.adoc]" yield the same result. Nevertheless, the recommended version is always preferable, so I will correct the

Re: Reformatting scanned text

2024-09-23 Thread jj
Put the cursor anywhere in the paragraph and choose *menu Text > Hard Wrap* while holding the ** key. On Monday, September 23, 2024 at 4:42:26 PM UTC+2 Mario Chabot wrote: > Simple. Just do a Find & Replace. > Find \n (end-of-line ) > Replace by space > > Le lundi 23 septembre 2024 à 10:09:20 UTC

Re: Codeless Language Module for LiveCode (nee RunRev)

2024-08-16 Thread jj
Hi Stam, Take a look at https://www.barebones.com/support/develop/clm.html#ExREComments. You could leave empty all the BBLMComment* keys and add this to your plist: *Comment Pattern* ** Here is an imaginary Stam Codeless Language Module that would be applied to files with .stam extensi

Re: Dynamic Text Factory ?

2024-08-14 Thread jj
Hi Robert, You could do this with a snippet of AppleScript like so: *try* *tell* *application* "BBEdit" -- Replace and with your user's name and textfactory's name. *set* vTextFactory *to* *POSIX file* "/Users//Library/Application Support/BBEdit/Text Factories/.textfactory" *repeat* *with

Re: Numbering Words

2024-07-12 Thread jj
AppleScript would be quite slow for so many lines. Provided perl is installed on your system, here is an example perl filter. Copy it to *~/Library/Application Support/BBEdit/Text Filters/add_w_column.pl* #!/usr/bin/env perl use strict; use warnings; my $set_numbe

Re: replacing specific characters within a grep match?

2024-06-27 Thread jj
In PCRE2, the capability to perform conditional replacements directly within the replacement pattern syntax isn't directly supported. You could do it with a scripting language (Perl, Python, PHP, JavaScript, etc.) that supports replacement callbacks. You will not be able to do it by a single BBE

Re: Working example of #SCRIPT# place holder in clipping

2024-05-22 Thread jj
Hi Gari, Use this script for a 90 characters line width: *tell* *application* "BBEdit" *set* vCount *to* 91 - (startColumn *of* selection) *set* vTxt *to* "" *if* vCount > 0 *then* *repeat* vCount *times* *set* vTxt *to* vTxt & "*" *end* *repeat* *end* *if* *return* vTxt *end* *tell*

Re: Use bbdiff to view differences between branches

2024-04-28 Thread jj
Using the -d flag seems to do what you expect. git difftool *-d* goodbranch buggybranch HTH Jean Jourdain On Saturday, April 27, 2024 at 11:19:43 AM UTC+2 Ted Stresen-Reuter wrote: > On Fri, Apr 26, 2024 at 8:51 PM Marshall Clow wrote: > >> On Apr 26, 2024, at 12:29 PM, Ted Stresen-Reuter >

Re: RegExp and search / replace question - removing "" when around a single word without whitespace

2024-04-18 Thread jj
mayonnaise-sauce" There might be more edge cases, so be cautious. Jean On Thursday, April 18, 2024 at 4:46:17 PM UTC+2 jj wrote: > Building on Kerri's solution to include non-breaking spaces, tabs and > linefeeds, etc. > > find: > "[\s\N{U+00A0}]*([^\s\N{U+00A0}&qu

Re: Any way to print differences of two text files?

2024-02-27 Thread jj
Hi Allen, I don't know if this is possible with BBEdit alone. But you could do it in a terminal with the help of command line utilities diff and aha , generating a colored HTML file. Install Diffutils and Aha: % brew

Re: Move cursor to start of indented line?

2024-02-20 Thread jj
You could do this with a bit of AppleScript: *try* *tell* *application* "BBEdit" *tell* *first* *window* *set* vLine *to* startLine *of* selection *tell* *first* *document* *set* vResult *to* *find* "^\\h*" searching in *its* *line* vLine option

Re: Is this possible to GREP?

2024-01-26 Thread jj
Hi Victoria, Here is a possible two pass solution: First: A Case sensitive Find / Replace : (?<=href=")([^#]+)#[^_]+_([A-Z][a-z]+)([A-Z][a-z]+)?([A-Z][a-z]+)?([A-Z][a-z]+)?([A-Z][a-z]+)?([A-Z][a-z]+)?([A-Z][a-z]+)?([A-Z][a-z]+)?([A-Z][a-z]+)?([A-Z][a-z]+)?(?=") Replacement:

Re: Trouble creating a CLM

2024-01-15 Thread jj
Hi Joaquin, My guess is that keywords are whitespace separated character runs – they don't contain whitespace. BBEdit probably chunks the keywords "before" matching against the regular expression chunk by chunk. For example what your regular expression matches against is the string "label2:", n

Re: Automatically indent python code

2023-12-27 Thread jj
gt; > Il giorno lunedì 25 dicembre 2023 alle 21:09:05 UTC+1 jj ha scritto: > >> Claudio, >> >> You should take a look at : >> https://github.com/psf/black >> HTH >> >> Jean Jourdain >> >> On Monday, December 25, 2023 at 6:05:52 PM UTC+1 Clau

Re: Automatically indent python code

2023-12-25 Thread jj
Claudio, You should take a look at : https://github.com/psf/black HTH Jean Jourdain On Monday, December 25, 2023 at 6:05:52 PM UTC+1 Claudio Pedrazzi wrote: > Hi everyone, > this is my first post here and I hope I am in the right place. I have a > python code of about a thousand lines, contain

Re: Piping to bbresults

2023-12-20 Thread jj
Hi Christopher, You could aggregate your patterns into a single regular expression and use it directly from BBEdit with the benefit of result sets, multi-file searches, matches highlighting, etc. Here is an unrolled example pattern: (?xx) (?i)(?# Case i

Re: Switching to project unix worksheet when in project

2023-12-18 Thread jj
Given that a worksheet named '*project.worksheet*' exists in your project and that your project window is the front window, this applescript should open it: *tell* *application* "BBEdit" *activate* *set* vFile *to* *file* *of* *first* *item* *of* (*documents* *of* *first* *project window

Re: Search pattern works in Notepad++ , but not in BBEdit

2023-11-30 Thread jj
Hi Samir, A few remarks. 1. The tag is not correctly closed in you XML example. 2. I can reproduce the issue you mention and effectively BBEdit is returning garbage in the 'Replacement Text' field of the playground even if it shows the correct \2 in the 'Capture Groups' table. 3. If you use

Re: short-cut 'Notes' window

2023-11-24 Thread jj
Hi Peter, 1. Activate the system AppleScript Menu in the menubar • Launch the Script Editor at Applications/Utilities/Script Editor.app • In Script Editor's settings, check the 'Show Script menu in menu bar' checkbox • Now you should have a permanent new Script menu on the righ

Re: Preventing a newline from being recognized by [\s]+ *without* using [[:blank:]]

2023-09-25 Thread jj
Hi Jim, As per the PCRE2 documentation, you could use *\h* instead of *\s* : https://www.pcre.org/current/doc/html/pcre2syntax.html#SEC4 CHARACTER TYPES . any character except newline; in dotall mode, any character whatsoever \C one code unit, even in UTF mode (best avoided) \d a decimal d

Re: Use the Number of Matches as Part of Replace Pattern

2023-08-22 Thread jj
Hi Christopher, You could use a perl Text Filter. Place this script in *~/Library/Application Support/BBEdit/Text Filters/add_reference_numbers.pl*: *#!/usr/bin/env perl* *use v5.14;* *use strict;* *use warnings;* *$/ = undef;* *my $i = 1;* *print <> =~ s/(?<=BEGINREF\s)\d*(?=ENDREF)/$i

Re: Using AppleScript to find and set an AS variable collects TMI (too much information)

2023-08-19 Thread jj
0-3]):[0-5][0-9] > and got that sorted. > > On Thursday, August 17, 2023 at 8:23:17 PM UTC-7 e2o wrote: > >> I'm also struggling with the expression: >> >> (?:[01][0-9]|2[0-3]):[0-5][0-9] >> >> On Thursday, August 17, 2023 at 8:04:20 PM UTC-7 e2o wrote:

Re: Using AppleScript to find and set an AS variable collects TMI (too much information)

2023-08-14 Thread jj
Hi Eric, Here is an example of how to get the values captured by a regex. *tell* *application* "BBEdit" *set* vDocument *to* *first* *text document* *of* *first* *window* *set* vTimeRegex *to* "(?:[01][0-9]|2[0-3]):[0-5][0-9]" *set* vRegex *to* "^(" & vTimeRegex & ")-(" & vTimeRegex & ")\\h+([

Re: Deleting all \n which are not followed by a number and a .

2023-07-07 Thread jj
Hi Rainer, To remove all line breaks (`\n`) except for the ones where the lines starts with a number followed by `.` : Search Pattern : `\n(?!\d+\.)` Replace Pattern: ` ` Note that the Replace pattern is a space to avoid concatenating together the lines. Best regards, Jean On Friday, July

Re: Need help with Bash text filter

2022-12-28 Thread jj
In case you want to close the terminal and stay in BBEdit, you can create a shell script in ~/Library/Application\ Support/BBEdit/Scripts/php-cs-fixer-example.sh (Adapt php-cs-fixer's path as per your configuration) : #!/usr/bin/env sh /opt/homebrew/bin/php-cs-fixer fix --rules=no_whit

Re: Need help with Bash text filter

2022-12-20 Thread jj
Hi Greg, If you use your script as a text filter, you should add an hyphen '-' after the beautysh command to have stdin as input to the command. like so: ... python3 ~/Library/Python/3.9/bin/beautysh - ... HTH, Jean Jourdain On Tuesday, December 20, 2022 at 4:01:20 PM UTC+1 y2k...@

Re: Grep help for musicxml

2022-12-05 Thread jj
Hi Marcel, You could try this. Find: (?s)())+)()\n((?:.(?!) Replace: \n\n\2\n\n\n\1\3 HTH Jean Jourdain On Monday, December 5, 2022 at 8:27:49 PM UTC+1 Marcel Lamers wrote: > It gets much simpler if I add e.g. a ! before every first. > I can then search for > ()([^!]+)()([^!]+)()

Re: Split a text file with tabs based on character position in a line?

2022-11-11 Thread jj
Another option (pun intended) is to select a multiline vertical insertion point selection by the cursor vertically (that is creating a vertical selection while holding the key) | ---+ / v abc*|*def abc

Re: Split a text file with tabs based on character position in a line?

2022-11-10 Thread jj
You could try a 'Replace All' with a regular expression using column width instead of character positions. Find: (.{65})(.{25})(.{35}) Replace: \1\t\2\t\3 HTH, Jean Jourdain -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support

Re: Copy markdown as HTML

2022-11-08 Thread jj
Oups! Hastily copy/pasted: * ... and call the script from menu Script > Apply Text Filter > copy_markdown_as_html. Should read: and call the script from menu Scripts > copy_markdown_as_html. On Tuesday, November 8, 2022 at 5:54:00 PM UTC+1 jj wrote: > You could try pandoc <htt

Re: Copy markdown as HTML

2022-11-08 Thread jj
You could try pandoc . Install it from Terminal with homebrew : % brew install pandoc Create this simple BBEdit script in ~/Library/Application\ Support/BBEdit/Scripts/copy_markdown_

Re: Convert XML to JSON?

2022-11-04 Thread jj
You could try yq . Install it from Terminal with homebrew : brew install python-yq Create this simple BBEdit text filter in *~/Library/Application\ Support/BBEdit/Text\ Filters/xml2json.sh* #!/bin/sh xq '.' and call the filt

Re: Sort via GREP involving tabs and invisibles

2022-10-16 Thread jj
Considering that list indentation is a form of compression, this BBEdit script *sort_and_merge_indented_list.applescript* decompresses the list, sorts it with the shell `sort` command,

Re: Scriptless Language Module help for text documents

2022-09-15 Thread jj
Hi Travis, There are a few issues with your module. 1. BBEdit reports an error in your module Menu BBEdit > Folders > Logs Check ~/Library/Containers/com.barebones.bbedit/Data/Library/Logs/BBEdit/Language Module Errors.log =

Re: Generating markdown table of contents?

2022-08-11 Thread jj
Sticking with Pandoc, you could use a BBEdit shell script to create a clickable table of contents at the beginning of the document. Create script in ~/Library/Application Support/BBEdit/pandoc-toc.sh #!/usr/bin/env sh pandoc \ --standalone \ --from=markdown \ --to=markdo

Re: Selecting/Highlighting Text via trackpad gesture not possible

2022-08-06 Thread jj
Good to know. Thank you for reporting back. On Friday, August 5, 2022 at 2:16:47 PM UTC+2 Nora wrote: > Just in case anyone else is running into this issue, I got it to work by > turning > *off* the "Force Click and haptic feedback" option in the macOS "Trackpad" > system preferences; a tip pr

Re: Selecting/Highlighting Text via trackpad gesture not possible

2022-08-04 Thread jj
Hi Nora, Might it be that the Preferences > Editing > Allow pinch-to-zoom to change magnification checkbox is deselected ? HTH Jean Jourdain On Thursday, August 4, 2022 at 5:08:20 PM UTC+2 Nora wrote: > BBEdit version 14.5.1 (14C208, Apple Silicon, sandboxed) > > I recently moved to a new mac

Re: How to set the cursor at the top of the document

2022-06-08 Thread jj
Hi Omar, >From Mac keyboard shortcuts : - *Command–Up Arrow*: Move the insertion point to the beginning of the document HTH Jean Jourdain On Wednesday, June 8, 2022 at 1:53:07 PM UTC+2 omn...@gmail.com wrote: > Hi and good day, > > If the excel

Re: Project collection object in BBEdit applescript

2022-06-04 Thread jj
and look at their contents), when I get one of those *project > collections* in an AppleScript, what I actually get is a file reference, > not a *project collection*. > > Neil Faiman > > On Jun 3, 2022, at 3:11 PM, jj wrote: > > Hi Neil, > > This AppleScript snippet

Re: Project collection object in BBEdit applescript

2022-06-03 Thread jj
Hi Neil, This AppleScript snippet might help you understand how BBEdit sees the project document hierarchy. set v4Spaces to "" tell application "BBEdit" set vProjectDocument to first project document set vProjectCollections to project collections of vProjectDocument

Re: Drag image into markdown document and generate HTML tag instead of markdown reference?

2022-05-28 Thread jj
Hi Craig, You should check the `documentWillInsertTextForDroppedImageFile` document attachment point. Manual page: 347/348 on documentWillInsertTextForDroppedImageFile(theDocument, theImageFile, proposedText) tell application "Acorn" to open theImageFile return proposedText

Re: CLM question

2022-05-15 Thread jj
onday, May 16, 2022 at 1:37:30 AM UTC+2 Tim Gray wrote: > Thank you! This is great. > > Can I bother you for an explanation for the folding part of the pattern? > I assume this is the second part of the function pattern (the part named > ‘function’). > > On Sun, May 15, 202

Re: CLM question

2022-05-15 Thread jj
Hi Tim, Here is an attempt for you special case CLM. Save it as ~/Library/Application\ Support/BBEdit/Language\ Modules/free42.plist and restart BBEdit. You should now have a 'Free42' language module that highlights files with the .free42 extension. HTH, Jean Jourdain -- http://ww

Re: I'm trying to script the Save Document command

2022-05-09 Thread jj
*set* vPosixPath *to* POSIX path *of* (vFile *as* *string*) > >*do shell script* "$HOME/asecho is NOT FTP file" & *the* quoted > form *of* vPosixPath > >*end* *if* > >*log* vFile > >*set* vPosixPath *to* POSIX path *of* (vFile *as*

Re: I'm trying to script the Save Document command

2022-05-09 Thread jj
vDocument's *file* > >*set* vPosixPath *to* POSIX path *of* (vFile *as* *string*) > >*do shell script* "$HOME/asecho is NOT FTP file" & *the* quoted > form *of* vPosixPath > >*end* *if* > >*log* vFile > >*set*

Re: Changing file NAMES with regex

2022-05-08 Thread jj
Hi Luca, For renaming folder contents with regular expressions I would recommend the command line utility rename . You can install it from Homebrew . In the terminal: % brew install rename And for help:

Re: I'm trying to script the Save Document command

2022-05-08 Thread jj
Hi David, `try ... on error` blocks are very useful for debugging scripts. Before porting it to a Document Script, test your logic in the Script Editor where you can use the `log` and `display alert/dialog` commands to debug. Use `the quoted form of` for paths included in your `do shell sc

Re: how to find a repeated 200-character sentence in a large text file

2022-04-30 Thread jj
Here is a BBEdit Text Filter that will scan the frontmost document's selected text (or the whole document in no selection) for the longest repeated substring and log a regular expression in the 'Unix Script Output.log' that allows to find the repetition. It works by replacing all non alphanumer

Re: Canonize emoji for an XML file

2022-04-16 Thread jj
Hi Community, Let's celebrate BBEdit's 30 years of existence. 👏 🎉 🎂 🍾 🥂 👉 👨🏼‍💻 & 🍀️ & 🦜 & 👥 Here is a Swift text filter that could help you prepare your inDesign birthday cards. Based on Unicode's Emoji regular expression and Swift's ICU regular expression engine. Save in ~/Library/Appl

Re: Formatting markdown tables in bbedit

2022-04-13 Thread jj
Hi Rainer, Did you check https://github.com/darkriszty/MarkdownTablePrettify-VSCodeExt ? Install with: % brew install node % npm install -g markdown-table-prettify Create a BBEdit Text Filter ~/Library/Application Support/BBEdit/Text Filters/markdown_table_prettify.sh: #!/usr

Re: Running script in background - i.e. not blocking BBEdit

2022-03-24 Thread jj
n nohup quarto preview "$BB_DOC_PATH" >& /dev/null & fi Jean On Thursday, March 24, 2022 at 4:48:57 PM UTC+1 jj wrote: > Hi Rainer, > > Good to see your are getting somewhere. > > I tested this on my setup and it seems to do what you are

Re: Running script in background - i.e. not blocking BBEdit

2022-03-24 Thread jj
;>> pidfile=$(dirname "${BB_DOC_PATH}")/quarto.$BB_DOC_NAME.pid >>> echo pid: $pid >>> echo pidfile: $pidfile >>> echo $pid > $pidfile >>> >>> But it has two problems: >>> >>> 1) I still have to click "cancel&

Re: Running script in background - i.e. not blocking BBEdit

2022-03-23 Thread jj
gt; > The second one, I will solve with quarto, and the first one, I can live > with. It would be nice, to have a message pops up which tells the user to > close the dialog once the preview is visible? > > Thanks, > > Rainer > > > On Tuesday, March 22, 2022 at 8:12:56

Re: Running script in background - i.e. not blocking BBEdit

2022-03-22 Thread jj
Hi Rainer, I suspect that BBEdit's Script menu will always be blocking because as far as I know it uses an XPCService. (This should be checked with Bare Bones support though!) I think of 2 other options that you could try: *Option 1. Use the menubar Script Menu.* • Activate the menubar Scr

Re: Sort lines sorting options Applescript difficulty

2022-03-21 Thread jj
Try this (Note the use of pipes to protect the name from conversion): *set* listSorted *to* *sort lines* *it* sorting options {|sort pattern|:bbed_sortPattern, sort subpattern:bbed_sortPattern} output options {replacing target:*true*} Seems like AppleScript replaces the `sort pattern` by `mat

Re: Converting decimal value of some numbers using Grep

2022-03-17 Thread jj
Howard, If it applies to you case you could use a literal find/replace. Uncheck the Grep checkbox in the Find/Replace window. Find: .1 Replace: .33 Find: .2 Replace: .67 Just my .2 cents. Best Regards, Jean On Thursday, March 17, 2022 at 12:21:53 AM UTC+1 Howard wrote

Re: Method for finding the Nth occurrence of a string in a data file?

2022-03-15 Thread jj
; > works like a charm. > > > > On Mar 14, 2022, at 5:32 PM, jj wrote: > > Hi Devon, > > This AppleScript script > <https://gist.github.com/mixio/0cc693aa710e42ebae2a6094141b2971> should > help you to select the inner contents of any Nth . > > HTH, &g

Re: Method for finding the Nth occurrence of a string in a data file?

2022-03-14 Thread jj
Hi Devon, This AppleScript script should help you to select the inner contents of any Nth . HTH, Jean Jourdain On Monday, March 14, 2022 at 8:53:48 PM UTC+1 devo...@gmail.com wrote: > Thanks Sam. That grep pattern is fantasti

Re: Tag conversion to a new format

2022-02-25 Thread jj
Hi Lux, Here are two perl text filters. Copy them to ~/Library/Application Support/BBEdit/Text Filters. You can test them from menu Text > Apply Text Filter. This one (tags_and_categories_to_list_pl.pl) is for your initial case (CSV -> hyphenated item per line) : #!/usr/bin/env perl use

Re: CLM pattern question

2022-02-16 Thread jj
Hi Tim, As far as I understand it, BBLMKeywordPatterns are matched against individual words composed of characters in the or . As a consequence the ^ anchor in a BBLMKeywordPatterns is sort of equivalent to \b and will always match at the start of a word. Start of line for an individual word

Re: Using GREP, need help to extract names and numbers from column

2022-02-10 Thread jj
Hi Howard, You could try this to get tab separated fields: Find: (\S+\.)(\S+)\h*\((\d+-\d+)\)\h*(?:and\h*(\S+\.)(\S+)\h*\((\d+-\d+)\))? Replace: \1 \2\t\3\t\4 \5\t\6 HTH, Jean Jourdain On Wednesday, February 9, 2022 at 10:42:41 PM UTC+1 Howard wrote: > > *I have a column wi

Re: grep for searching

2022-02-06 Thread jj
Find: (?<=/)(?:d([^\s/]|\\\x20)*?\.zip)\b Or commented: (?x)(?# Use multi-line and comments) (?<=/) (?# Look behind a slash not including it in the match) ( (?# Start of capture \1) d (?# Literal 'd') (?: (?# Start

Re: Need GREP to reorder a list of names

2022-02-03 Thread jj
Hi Howard, BBEdit has a nice option to help rearrange columns in CSV files : BBEdit > menu Edit > Columns > Rearrange Columns… Once the columns are in the desired order, if required you can remove the commas with a find/repl

Re: Project specific keyboard shortcuts?

2022-02-03 Thread jj
Hi Rainer, This script looks for the existence of an optional *.rainer.conf* file in the parent directories. If the file exists it reads it, parses it and acts in consequence. Same logic could be applied based on project window names, document file types, document file languages, etc. HTH Jea

Re: Convert to CDATA/XML?

2022-01-26 Thread jj
Hi @lbutlr, One possible approach is with node.js and the node module html-entities . Create a BBEdit Text Filter with this snippet into ~/Library/Application Support/BBEdit/Text\ Filters/html_entities_to_xml_entities.js #!/usr/bin/env node

Re: Activer un Language Module?

2022-01-25 Thread jj
guage Modules documentation : https://www.barebones.com/support/develop/clm.html HTH Jean Jourdain On Sunday, January 23, 2022 at 10:25:23 AM UTC+1 jj wrote: > Bonjour Christian, > > 1. Vérifiez que votre module est au format correct. Dans le terminal: > > % *

Re: Activer un Language Module?

2022-01-23 Thread jj
Bonjour Christian, 1. Vérifiez que votre module est au format correct. Dans le terminal: % *plutil** ~**/Library/Application\ Support/BBEdit/Language\ Modules/Ariane.plist* *~/Library/Application Support/BBEdit/Language Modules/Ariane.plist: OK* 2. BBEdit associe un fichier à u

Re: Custom Completion List?

2022-01-19 Thread jj
Hi Shawn, If you are not yet able to autocomplete within the Shawn language, try adding this to your Shawn.plist BBLMSpellableRunKinds * BBLMCompletableRunKinds * Jean -- This is the BBEdit Talk public discussion group. If you have a feature request

Re: Custom Completion List?

2022-01-18 Thread jj
Shawn, If you have hundreds/thousands of possible completions, you could simply use the System Text Replacement feature. https://support.apple.com/en-bh/guide/mac-help/mchl2a7bd795/mac You can export/import a hand crafted Text Substitutions.plist into 'System Preferences > Keyboard > Text' by

Re: Custom Completion List?

2022-01-18 Thread jj
Shawn, 1. It seems that the problem is in the "Identifier and Keyword Character Class". By specifying *\S* (Anything that is not whitespace) the starting square bracket is included in the completion prefix. Obviously there is no "[ra..." entry in "BBLMPredefinedNameList". Try with this: Id

Re: Custom Completion List?

2022-01-18 Thread jj
Hi Shawn, Here is a Shawn.plist that follows Rich's recommendations and seems to work regarding completions. There was a misconfiguration in the .plist I originally posted. Sorry for that. Apparently the key defining 'Identifier and Keyword Characters' prevented BBEdit from displaying completi

Re: Style all occurrences of text

2022-01-08 Thread jj
Hi Raleigh, This Applescript snippet is a bit of a hack that takes advantage of Unicode combining codepoints to create a p͇s͇e͇u͇d͇o͇ ͇u͇n͇d͇e͇r͇l͇i͇n͇e͇ ͇s͇t͇y͇l͇e͇. It works by inserting the combining underline codepoint (U+034

Applescript & Javascript for automation resources

2022-01-07 Thread jj
Hi, Media Mouth, Starting a new thread in response to your question: https://groups.google.com/g/bbedit/c/ZfG2rHr89rA/m/4cvnFM4eBgAJ Some links to Applescript and Javascript for automation online documentation: https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Concept

Re: [ OFFLIST ] Re: Need to increment a counter for chapter count

2022-01-07 Thread jj
Hi David, Here is another option with Javascript for automation this time. Copy this snippet into the Script Editor, choose Javascript as the language in the languages menu under the window titlebar and run it on BBEdit's front window. function run() { var chapterNumber = 1;

Re: Multi-file search error "Operation not permitted by the OS.

2022-01-05 Thread jj
Hi Ed, This tech note about App Sandboxing might help you: https://www.barebones.com/support/bbedit/AppSandboxing.html HTH Jean Jourdain On Wednesday, January 5, 2022 at 1:55:25 AM UTC+1 buckyjunior wrote: > The first thing I might ask is if you have the App Store version or > directly from

Re: First Use - quick way to get a list of numbers for output

2021-12-30 Thread jj
Hi Lorenz, Execute this snippet of AppleScript with Script Editor: tell application "BBEdit" set vContents to "" repeat with i from 1 to 15 set vNumber to i as string if i < 10 then set vNumber to "0" & vNumber end if

Re: Custom Text Colors for Defined Elements?

2021-12-23 Thread jj
Hi Shawn, Here is a minimal Codeless Language Module that should do what you want. Name it "Shawn.plist". Copy it in ~/Library/Application Support/BBEdit/Language Modules. Restart BBEdit. The Language Module should now be listed in the Prefe

Re: How to have \D ignore newline character?

2021-12-12 Thread jj
Hi Tim, Try using a negative character class like [^\d\n\r] instead of \D. HTH Jean Jourdain On Sunday, December 12, 2021 at 6:21:10 PM UTC+1 Tim A wrote: > Simple task to strip out all non-digits in telephone numbers. \D works but > also matches newline at the end of every line. Is there a w

Re: Custom sequencing

2021-12-08 Thread jj
Execute this snippet of AppleScript with Script Editor: tell application "BBEdit" set vContents to "" repeat with i from 1 to 250 set vNumber to i as string if i < 10 then set vNumber to "00" & vNumber else if i < 100 then

Re: Grep searching - how to ignore the first word of the sentence

2021-12-08 Thread jj
It all depends on the definition of a sentence and if you want to match the exact word or words "starting with". Considering sentences as strings of characters separated by dots and exact word matching then: Find: ([^\.\s]\s+)(Potato)\b Replace: \1\l\2 Sample: Potato is good an

Re: TextEdit acts like default text editor at times

2021-11-29 Thread jj
Hi Brian, The duti command line utility might help you. You can install it with Homebrew: % brew install duti Read the man page: % man duti To get default applications information for .txt files: % duti -x txt BBEdit.app

Re: Padding a missing line

2021-11-26 Thread jj
Hi Tim, Find: (? On Friday, November 26, 2021 at 6:14:55 AM UTC-8 Kaveh wrote: > >> Is "Joint" or "Single" the only words that can be on line after phone >> number? >> > > There are a few more...here's the complete set: > Joint > Joint Lifetime > Joint Non-resident > Joint Senior > Senior Single

Re: Typewriter mode possible?

2021-11-24 Thread jj
ect? > > On Wednesday, November 24, 2021 at 10:21:19 AM UTC+1 jj wrote: > >> Hi Rainer, >> >> You can *"kind of"* simulate typewriter mode with this applescript. >> It only has effect once your text overflows the window because it takes >> advantage o

Re: Typewriter mode possible?

2021-11-24 Thread jj
BTW, you should also set BBEdit Preferences > Editing > 'Extra vertical space ("overscroll") in text view' to 'Full Window'. Jean On Wednesday, November 24, 2021 at 10:21:19 AM UTC+1 jj wrote: > Hi Rainer, > > You can *"kind of"* simula

Re: Typewriter mode possible?

2021-11-24 Thread jj
Hi Rainer, You can *"kind of"* simulate typewriter mode with this applescript. It only has effect once your text overflows the window because it takes advantage of the fact that, when jumping around, BBEdit repositions the current line at ± 25% of the window height. Note that there is a bit of

Re: Emmet for css

2021-11-11 Thread jj
Hi Johan, I don't know if at the moment BBEdit expands Emmet CSS abbreviations. Meanwhile this applescript does: emmet_expand_css_abbreviation.applescript Copy it to your ~/Application Support/BBEdit/Scripts/ directory. Configur

Re: The incredible shrinking selections.

2021-11-08 Thread jj
Hi Christopher & Christopher, Seems there is an off by one somewhere. You should mail the issue to supp...@barebones.com. Regards, Jean Jourdain *tell* *application* "BBEdit" *set* vDocument *to* *make* new *document* with properties {contents:"def do_something( doohickeis )\ndoohickeis.ea

Re: Find and Replace pattern that includes a variable string of text

2021-11-07 Thread jj
Hi Ralph, Find: (?s)XX(.+?)XX Replace: Y\1Y Some explanation: (?s) means allow the dot (which is the regular expression wildcard character) to match at new lines. (.+?) means capture one or more characters non-greedily. \1 is the result of that capture. For a

Re: Find and Replace multiple queries at once

2021-11-05 Thread jj
Hi Pu Koh, You could use BBEdit's Text > Canonize ... command. Check "Canonize Using Grep Patterns" in the manual page 140. With this sample transformation file (Note that find and replace expressions are separated by a tab): # -*- x-bbedit-canon-case-sensitive: 1; x-bbedit-canon-match-words: 0

Re: Remove line returns from within a paragraph but not between paragraphs

2021-11-04 Thread jj
Text > *Remove Line Breaks* is indeed a very useful command. Thanks Jeffrey for pointing to it. But *Remove Line Breaks* doesn't make a distinction between left aligned text and indented text as the proposed regular expression find/replace does. In most cases, you want indented text to be left

Re: Remove line returns from within a paragraph but not between paragraphs

2021-11-03 Thread jj
Hi Gavin, You could use a capture instead of a positive lookahead assertion and skip the trailing whitespaces. Find: (\S)\h*\R(\S) Replace: \1 \2 HTH, Jean Jourdain On Wednesday, November 3, 2021 at 11:02:07 AM UTC+1 gavin...@gmail.com wrote: > I have a lot of text that has been copied fro

Re: AppleScript -1728 error with replace selection

2021-10-23 Thread jj
Hi Sonic, If not otherwise specified a property is relative to the current "Tell" object. So line 34, selection is relative to the current "Tell" object, in this case text document 1. This triggers the error because text documents don't have a selection property. You can reproduce it with:

Re: script for url to set ina message

2021-10-11 Thread jj
Hi Wim, Not all applications respond to the same set of commands, elements, properties, enumerations, etc. To view an application's Terminology use Script Editor > File > Open Dictionary... or drop the icon of the application upon the Script Editor icon. Check this link on how to get the fron

Re: Syntax for file filter in AppleScript?

2021-10-09 Thread jj
Hi Sonic, As far as I know there is no way to call filters by name or to create filters with AppleScript. Nonetheless, you can record them and use them in your scripts. 1. In BBEdit, open the "Multi-File Search" window. 2. Configure the search options you want –– File and Folders filters in

Re: Trying to improve the flake8 parser in bbresults

2021-10-08 Thread jj
Hi Johan, You could try this: flake8 foobar.py | sed -E 's/([FEW][0-9]+)/\1 \1:/g' | bbresults --pattern flake8 Piping through sed will repeat the 'type' twice so it appears at the start of the message. HTH Jean Jourdain On Thursday, October 7, 2021 at 10:14:54 PM UTC+2 Johan Larsson wrote:

Re: Confused by differences between AppleScripted Replace and manual BBEdit Replace All

2021-10-07 Thread jj
Sonic, You don't need to use grep substitutions in replacement expressions. set StoryTitle to "Example Story" set ConcatStoryTitle to "ExampleStory" tell application "BBEdit" tell text document 1 set vRegex to "(\\d\\d?)(.+?)" set vReplacement to "\\2" replace vRegex u

Re: Make new HTML document from template in AppleScript: How?

2021-10-05 Thread jj
ted processing), having those call the templates or otherwise plant > template content into newly-created HTML documents. > > Is my current approach to automation wrong-headed/inefficient? If so, what > would be a more optimized approach? > > > I’ve read the AppleScript L

  1   2   >