Switching the find and replace strings

2009-11-22 Thread jj
Does anybody know of a command (keyboard shortcut, applescript, ...) to switch the find and replace strings in the find / multifile find dialogs. I often review the replaced strings after a 'Replace all' by searching with the replacement string and for now the only way I found to do it is by

Re: Switching the find and replace strings

2009-12-16 Thread jj
set text 2 of front window to tmp end if end tell Best regards. On Nov 21, 12:22 pm, jj goo...@mixio.com wrote: Does anybody know of a command  (keyboard shortcut, applescript, ...) to switch the find and replace strings in the find / multifile find dialogs. I often review the replaced

Subversion 1.7

2011-11-29 Thread jj
I upgraded subversion to version 1.7 and since then bbedit only detects that a file is in a svn working copy if that file is at the root of the working copy. If the file is in a working copy sub-directory the bbedit svn menu items are disabled. Apparently the working copy metadata storage was

Re: Text Factory to Frontmost Text File

2017-03-08 Thread jj
Hi, Thanks Patrick for this tip. BTW, when using as described, a unix Text Filter in a Text Factory the BB_DOC_* environments variables seem not to be set — they are nevertheless perfectly accessible when using the Text Filter. Is there a way to get access to them from a Text Factory called

Re: Twig language module?

2017-05-31 Thread jj
Copy the plist xml code below to file "/Users/.../Library/Application\ Support/BBEdit/Language\ Modules/Twig.plist" Kind regards. http://www.apple.com/DTDs/PropertyList-1.0.dtd;> BBEditDocumentType CodelessLanguageModule BBLMColorsSyntax BBLMIsCaseSensitive

Re: Pattern matching that will exclude items matching another pattern

2019-02-05 Thread jj
Did you try : N\. \\'93[A-Za-z, ]*[A-Z][A-Za-z, ]*\\'94 it should exclude [a-z,]+ sequences Best regards, Jean Jourdain -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "supp...@barebones.com" rather than posting to

Re: Ledger syntax coloring

2019-12-22 Thread jj
Nico, Here is a Ledger.plist with tweaked regexes. https://gist.github.com/mixio/4f233eb409c287101277502505e6b644 The BBEdit Help > Grep Reference is a precious source of information if you want to further adapt the regexes to your needs. Best regards. Jean -- This is the BBEdit Talk

Re: Can anyone help with Script that formats and replaces JSON?

2020-01-30 Thread jj
Hi, Here is my take on a script to apply jq on a selection in BBEdit. Use at your own risks, it has not been thoroughly tested. https://gist.github.com/mixio/b230c292b8f08fe9c7370eb67b344cf2 Best regards. Jean Jourdain -- This is the BBEdit Talk public discussion group. If you have a feature

Re: Backreferences in codeless language modules

2020-04-02 Thread jj
Hi Ain, Some of the required BBLM keys in your example appear to be misplaced or absent. Here is a *not thoroughly tested* example that seems to work. The modified Function Pattern is commented out because standard function type keys in Language Features will probably do a better job than

Re: How to open two files and see them at same time in Mac

2020-05-18 Thread jj
Little known feature but easiest way to compare any two files in BBEdit : 1. Command-click select the two files you want to compare in the sidebar. 2. Right-click on any of them in the sidebar and in the contextual menu, select the "Compare" menu item. The two files will be presented side by

Re: Need some help with multiple search-replace Apple script

2020-10-13 Thread jj
Mathias, It would be way simpler to just use the "Find and Replace" window using the below regular expressions and replacement strings. In the find window check the "Grep" and "Wrap around" checkboxes and leave the other checkboxes unchecked. If it works for your purpose in the "Find"

Re: AppleScript question

2020-10-11 Thread jj
Hi Greg, Here is a script that might do what you want tell application "Safari" set vContents to source of first document set vName to name of first document end tell tell application "BBEdit" tell first window set vDocument to make new document at beginning with properties {name:vName,

Re: AppleScript question

2020-10-11 Thread jj
n it's > own tell block, but I'm still missing something. > > On Sunday, October 11, 2020 at 4:46:59 AM UTC-7 Greg Raven wrote: > >> Ah, so. Thank you! It never occurred to me that I needed a nested tell >> block. >> >> On Sunday, October 11, 2020 at 12:53:16 AM UTC-7 j

Re: .kit should be as .html - but it isn't

2020-09-28 Thread jj
Vlad, On the "Custom filename extension mapping" in the language preferences try to put just ".kit" for the suffix (without the quotes and with a preceding dot) and of course HTML for the language. Best regards, Jean Jourdain On Saturday, September 26, 2020 at 4:35:42 PM UTC+2 Vlad

Re: Cobalt2 color scheme

2020-10-02 Thread jj
A few things I noticed with .bbColorSchemes: 1. The plist accepts different color specifications You can use RGBA: BackgroundColor rgba(0.979995,0.979995,0.979995,1.0) or HSLA: InsertionPointLineHighlightColor hsla(0.760, 0.310, 1.000, 1.000) or web colors #RRGGBB: InvisibleSpacesColor

Re: Bringing the "Unix Script Output" log to the front automatically.

2020-11-20 Thread jj
As of BBEdit version 13.5.2 (415056, 64-bit Intel, sandboxed), I observe a similar behavior. When a #! script is executed, if the "Unix Script Output.log" window is *not* open, BBEdit will open it and bring it to the front. *But* if the "Unix Script Output.log" window was *already open*,

Re: Multi-File Extract: source file names in results list?

2021-01-20 Thread jj
Hi Martin, 'File menu' > 'Export as text ...' usefully exports the results of a multi-file search. Maybe that's something you could use. HTH Jean Jourdain -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email

Re: Multi-File Extract: source file names in results list?

2021-01-20 Thread jj
Hi Martin, The 'Export as Text ...' menu item should be active if the Multi-File Search Results window is the front window and is not empty. Best regards. Jean Jourdain -- This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email

Re: More order in Scripts menu

2021-05-11 Thread jj
Hi Rainer, >From the *excellent* BBEdit User Manual;-) *menu Help > User Manual* *Organizing Scripts* *Items in the Scripts menu and Scripts palette are displayed in alphabetical order by default, but you can force them to appear in any desired order by including any two characters followed

Re: Running bbedit from an XQuartz-launched terminal

2021-05-21 Thread jj
Hi Galen, This appear to work on my setup (Catalina). https://discussions.apple.com/thread/251065137?answerId=252016248022#252016248022 > 1) I run Apple Terminal, which works well under Catalina. > 2) from Apple Terminal I run xterm which activate XQuartz > 3) Now XQuartz inherites the

Re: Automator actions and Grep: Extracting lines

2021-05-20 Thread jj
Miguel, If you are use Automator and AppleScript, "System Events" has some useful XML parsing functionality. See : https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/WorkwithXML.html Your input XML could be parsed with

Re: Text filters to format JSON and XML

2021-05-26 Thread jj
Hi Arthur, For JSON, I am very happy with 'jq'. https://stedolan.github.io/jq/ Install it from homebrew: % brew install jq or download it from their site. Then create a text filter named "jq.sh" like so: ``` #!/usr/bin/env sh jq '.' ``` place the text

Re: Extract number within parentheses using GREP

2021-06-03 Thread jj
Hi Howard, You can use this regex in the Find field: \d*(?:\((\d+)\))?\d*(?:\((\d+)\))?\d*(?:\((\d+)\))?\d*(?:\((\d+)\))?\d*(?:\((\d+)\))?\d* with this in the Replace field: \1 \2 \3 \4 \5 It can find from 1 to 5 parentheses. Repeat the (?:\((\d+)\))?\d* pattern and the corresponding

Re: Grep find/replace numbers

2021-05-22 Thread jj
Hi Ron, Here is a regular expression that should match your pattern: <(loc2?)>[1-5](?:\.\d+)+ The same but commented: (?x)(?# allow comments and whitespace) < (?# start of opening tag) ( (?# start of capturing parenthesis) loc

Re: Extract number within parentheses using GREP

2021-06-01 Thread jj
Here is Neil 3 step process as one text filter ```sh #!/usr/bin/env sh perl -pe '$_ = "$.:$_"' | perl -ne 'print if /\(/' | perl -pe 's/\d*\((\d*)\)\d*/ \1/g' # add line number # keep only lines containing a '(' # ouput only digits enclosed in parenthesis ``` Regards, Jean

Re: Multiple greps for extracting portions of multiple files

2021-07-04 Thread jj
gt; > > > *The three grep patterns are:* > > (?<=Artist > )(.*)(?=) > > (?<=Date of Birth > )(.*)(?=) > > (?<=Date > )(.*)(?=) > > The current results are working well independently (the text in blue) - > but I'd li

Re: Complicated workflow from pdf in Acrobat to BBEdit , back to another pdf

2021-07-04 Thread jj
Hi Francisco, Here is an example applescript that could be customized for your workflow: https://gist.github.com/mixio/b9c4d97ae556fe6d9d16a6c3fb30f43a Another option is to use Automator where there are actions for listing folders, extract PDF's text, create text file, etc. If needed will

Re: Find and replace

2021-07-08 Thread jj
Did you check the "Grep" checkbox in the "Find" window ? On Thursday, July 8, 2021 at 12:16:38 PM UTC+2 Arejay wrote: > Hi, > New to group and BBEdit. > I need to find and replace a line return with \\ plus a line return i.e. > \r with \\\r > but it doesn't work. > I'm guessing this is because

Re: Searching an html tag with Applescript and BBEdit

2021-06-28 Thread jj
Hi Murat, Might it be that the insertion point in your file is past the tag and the find wrap around option is not set? Try setting the "wrap around" option to true in the find command: *find* "" searching in *text* 1 *of* *text window* 1 options {search mode:*grep*, starting at top:*true*,

Re: Searching an html tag with Applescript and BBEdit

2021-06-28 Thread jj
Script debugger gives the following AS execution error: > It is impossible to obtain the found object of {found:true, found > matches:{{result_file:file "HFS path to my file", result_kind:note_kind, > start_offset:487, end_offset:494, result_line:9, message:"Bla bla > bla"}

Re: Newbie problem - Tech support sent me here

2021-06-27 Thread jj
Hi Neill, I notice that the scripting error you describe in your first post is: >A scripting error has occurred: >sh: /VCTTools/bat/hdbgsub.sh: No such file or directory Yet in another post you add: >The HydroV_dbg.scpt file invokes the script hdbgsub.sh which resides in

Re: Newbie problem - Tech support sent me here

2021-06-27 Thread jj
sh HD (has different icon, might not be a folder) > > Mackintosh - Data > > If I double-click Mackintosh - HD, I see the folder VCTToolds. > > So VCTTools is not where thought it was. > > So how and where do I move VCTTools? > > > Thanks, > &g

Re: Newbie problem - Tech support sent me here

2021-06-27 Thread jj
gt; > Neills-MacBook-Pro:~ neillsmith$ > > What the heck is wheel? > > Neill > On Sunday, June 27, 2021 at 1:57:23 PM UTC-4 jj wrote: > >> Neill, >> >> The path /Volumes/Macintosh HD - Data/VCTTools contains spaces. >> You should quote paths that conta

Re: Newbie question: Find terms in list and highlight

2021-06-27 Thread jj
Hi Zoe, Very interesting topic. The more you think of it the more questions it brings: • what about capitalization, should "Dog" or "DOG" count as "dog"? • what about plurals, should "dogs" count as "dog"? • what about expressions containing sub-expressions, should the "dog" in "dog

Re: Multiple greps for extracting portions of multiple files

2021-07-04 Thread jj
Hi Kim, If you could provide some sample text, grep patterns and expected results, it would be easier to answer your question. Meanwhile this pattern may help: Find: (?s)(?Pfirst_pattern|second_pattern).*?(?Pfirst_pattern|second_pattern) Replace: \P, \P Sample.txt -- first_pattern bla bla

Re: Trying to remove all empty lines with this grep isn't working

2021-04-27 Thread jj
Hi David, Can it be that your file has Unix line breaks and you are trying to match carriage returns? There are 3 forms of line breaks: • Unix (LF - linefeed) that can be matched with \n • Legacy Mac (CR - carriage return) that can be matched with \r • Windows (CRLF) that can be matched with

Re: Unicode regex matches 's' and 'k'

2021-04-30 Thread jj
Hi Sven, Is it possible that you did a case insensitive search (the "Case sensitive" check box was unchecked in the Find window)? In this case it is not a bug but simply Unicode case conversion, your regex finds the "lowercase" version of this two Unicode character: Unicode Character “K”

Re: Generating worksheets programmatically

2021-04-05 Thread jj
Hi Bruce, Here is an intend to do this with a shell script (if I understood correctly your problem). The --worksheet flag has to be used with a -t flag naming the worksheet, otherwise BBEdit appears to create a second document with the passed name. ```shell #! /bin/sh WORKSHEET="ws_test_01" ;

Re: Generating worksheets programmatically

2021-04-06 Thread jj
Bruce, With Charlie's tip you can go full perl. ```perl #!/usr/bin/perl use strict; use warnings; my $project = 'abc'; my $dir = '/Users/me/test'; my $wksht_file_name = 'ws_test_01'; my $wksht_tmpl = --- You received this message because you are subscribed to

Re: Open a path in a text file

2021-03-14 Thread jj
@lbutlr, Here is an AppleScript that might solve your problem : https://gist.github.com/mixio/7e3a909d391b30853c3cc39efb68d51a Copy it somewhere in ~/Library/Library/Application\ Support/BBEdit/Scripts. After relaunching BBEdit, you will be able to use it from the Script Menu in BBEdit and

Re: Open a path in a text file

2021-03-14 Thread jj
* copy it to ~/Library/Application\ Support/BBEdit/Scripts On Sunday, March 14, 2021 at 2:27:00 PM UTC+1 jj wrote: > @lbutlr, > > Here is an AppleScript that might solve your problem : > > https://gist.github.com/mixio/7e3a909d391b30853c3cc39efb68d51a > > Copy it somewhere

Re: Deleting a file via AppleScript

2021-03-19 Thread jj
Hi, Alfredo, Instead of deleting your file, you should move it to the trash so you can recover it in case of error. *set* vFile *to* *POSIX file* "/path/to/your/file" *tell* *application* "Finder" *move* vFile *as* *alias* to *the* trash *end* *tell* Best regards, Jean Jourdain -- This

Re: Sorting transcripts

2021-03-12 Thread jj
@ajames, Maybe this can help you manually execute the workflow described by James. 1. Create an empty bbedit text document: File > New > Text Document 2. Insert your files into the new document: Edit > Insert > File Contents... 3. Check that the imports are separated by a blank

Re: Feature request: switch between projects in the same window

2021-03-01 Thread jj
Hi everyone and the great BBEdit team, +1 for this request. Being able to tab project windows would be a very useful addition. [image: tabbed-window.png] Kind regards, Jean Jourdain On Monday, March 1, 2021 at 9:04:42 PM UTC+1 Mark Gardner wrote: > I make heavy use of BBEdit projects,

Re: Converting to non-latin entities in BBEdit?

2021-02-25 Thread jj
Omar, If you want to selectively convert some characters to html entities, you could use the BBEdit Canonize command: Menu 'Text' > 'Canonize ...' with a canonize file in the form: ``` # -*- x-bbedit-canon-case-sensitive: 1; x-bbedit-canon-match-words: 0; x-bbedit-canon-grep: 1; -*- À \ Á \

Re: Reverse order of lines

2021-03-08 Thread jj
Hi Ted, Go to Menu 'Text' > 'Run Unix Command ...', type: "tail -r", choose your preferred output option and click 'OK'. https://stackoverflow.com/questions/742466/how-can-i-reverse-the-order-of-lines-in-a-file HTH. Best regards, Jean Jourdain On Monday, March 8, 2021 at 6:15:00 PM UTC+1

Re: Reverse order of lines

2021-03-08 Thread jj
Wow. Parallel thinking happened here ;-) On Monday, March 8, 2021 at 6:27:44 PM UTC+1 jj wrote: > > Hi Ted, > > Go to Menu 'Text' > 'Run Unix Command ...', type: "tail -r", choose your > preferred output option and click 'OK'. > > > https://stackoverflow.c

Re: Where are the replaced files & names?

2021-02-23 Thread jj
Dick, Your question looks more related to Photo Mechanic than to BBEdit and you might get a more informed help from the Photo Mechanic forum : http://forums.camerabits.com If you search for "BBEdit" there are a few posts. Best regards, Jean Jourdain On Tuesday, February 23, 2021 at

Re: RegEx in JS question

2021-02-23 Thread jj
Hi Ted, BBEdit regular expressions are based on PCRE2 (see credits in 'BBEdit about'). For quick reference the BBEdit Help is excellent: 'Help menu' > BBEdit Help > Quick Reference > Grep Reference. For the definitive documentation on PCRE:

Re: Keep Text Filter Output In Original Window

2021-04-15 Thread jj
Hi Matt, I tested your script. When placed in the "~/Library/Application Support/BBEdit/Scripts" directory and called from the "Script > exec_lines.pl" menu item, it does what you report. It prints to 'Unix Script Output.log'. But if placed in the "~/Library/Application Support/BBEdit/Text

Re: How to grep a list of hyperlink to capitalise the words

2021-04-19 Thread jj
Hi Francisco, Here is a BBEdit Text Filter in PHP that capitalizes the text of hyperlinks. Save it as "~/Library/Application Support/BBEdit/Text Filters/capitalize_links_php.php" and you can call it from the "Text" > "Apply Text Filter" > "capitalize_links_php" menu item. ```PHP

Re: Using BBEdit for markdown presentation?

2021-04-19 Thread jj
Hi all, Here is a version that should not fail when encountering punctuation. ```PHP #!/usr/bin/env php ]+?>)/iusx', $string, -1, PREG_SPLIT_DELIM_CAPTURE); $m = count($array); $i = 0; while($i < $m) { if (strpos($array[$i], '<') === 0) {

Re: Maximise Window from applescript?

2021-04-14 Thread jj
Hi Rob, This AppleScript seems to do the trick. ```applescript use AppleScript version "2.7" use scripting additions tell application "BBEdit" activate tell application "System Events" try tell process "BBEdit" set

Re: Is BBLMRunColors only a coded language module feature.

2021-08-24 Thread jj
Hi Christopher, Here is a minimal Codeless Language Module for an hypothetical "Christopher" language that demonstrates the use of color runs. Save it as Christopher.plist in ~/Library/Application Support/BBEdit/Language Modules. http://www.apple.com/DTDs/PropertyList-1.0.dtd;>

Re: Is it possible to make a keyword / variable / predefined name with delimeter?

2021-08-24 Thread jj
Hi Daniel, Here is a minimal Codeless Language Module for an hypothetical "Daniel" language that accepts hyphens in keywords. Save it as Daniel.plist in ~/Library/Application Support/BBEdit/Language Modules. http://www.apple.com/DTDs/PropertyList-1.0.dtd;> BBEditDocumentType

Re: Is it possible to make a keyword / variable / predefined name with delimeter?

2021-08-24 Thread jj
t 12:18:06 UTC+3 Daniel Paz wrote: > >> thanks it worked! btw how can i create new colors? for example if i go to >> prefrences -> text colors I can see colors of "CSS", "HTML" and more... how >> can I create one as well? or define fixed colors in my

Re: Is it possible to make a keyword / variable / predefined name with delimeter?

2021-08-24 Thread jj
Paz wrote: > i tried, but the numbers of "-" not working, only chars. > > On Tuesday, 24 August 2021 at 13:37:46 UTC+3 jj wrote: > >> Try wrapping the regular expression in a CDATA, like so: >> >> >> >> >> On Tuesday, August 24, 20

Re: LSP configuring

2021-08-27 Thread jj
ile and doesn't work. % ls -al `which css-languageserver` lrwxr-xr-x 1 jj admin 66 Aug 18 21:17 /usr/local/bin/css-languageserver -> ../lib/node_modules/vscode-css-languageserver-bin/cssServerMain.js Try recreating this symlink with an absolute path (. % r

Re: grep 2 text strings and extract them to the SAME line of output?

2021-08-25 Thread jj
Hi BBLuv, Find: ]+NAME="([^"]*)"[^>]+LIKES="([^"]*)"[^>]*> Replace: \1 -- \2 and use the Extract button of the find window. HTH Jean Jourdain On Wednesday, August 25, 2021 at 2:12:48 PM UTC+2 BBLuv wrote: > Hi - non technical user here, proud to have figured out part of my goal.

Re: script/text filter advice

2021-08-30 Thread jj
Hi Tim, BBEdit offers plenty of options to manipulate text: • Scripting with Script Editor or Script Debugger using BBEdit's rich vocabulary of objects and commands: ◦ AppleScript, AppleScriptObjc, JavaScript • Any executable that can read BBEdit's environment variables: ◦

Re: LSP configuring

2021-08-16 Thread jj
Hi Jan Erik, Did you follow the instructions in https://www.barebones.com/support/bbedit/lsp-notes.html ? They contain this recommendation: However, at this writing we recommend that you not rely on the Xcode-bundled clangd, because it is out of date and has bugs that cause it to respond

Re: Copying grep match to clipboard

2021-08-15 Thread jj
Hi Eric, This snippet of AppleScript might help you. try tell application "BBEdit" set vText to "" tell first document of first window set vRegex to "(?s)\\A(.*?)\n\\s*\n" -- Captures everything at the beginning of a document up to but not including the first blank line. set vMatch to find

Re: Is this the best workflow to merge?

2021-08-25 Thread jj
Hi David, 1. Create a new empty document. 2. Then choose Menu Edit > Insert > File Contents ... 3. In the presented dialog click the bottom right "Options" button and check which options you want. [ ] Include separators [√] Ensure line break after each inserted file (Highly

Re: grep 2 text strings and extract them to the SAME line of output?

2021-08-25 Thread jj
ributes is present? bonus challenge: and if the attributes are not in > that order? > Great big thanks > > On Wednesday, August 25, 2021 at 4:53:49 PM UTC+3 jj wrote: > >> >> Hi BBLuv, >> >> Find: >> >> ]+NAME="([^"]*)"[^>]+

Re: Using Black as text filter

2021-09-05 Thread jj
Hi Maxime, Passing the --quiet flag seems to do the trick. #!/bin/bash black -q - HTH Jean Jourdain On Sunday, September 5, 2021 at 1:25:20 AM UTC+2 m...@maximepigeon.com wrote: > For reference, I ended up using Black's (private) method format_str() > like so: > > #!/usr/bin/env python3 >

Re: Can anyone help with Script that formats and replaces JSON?

2021-09-17 Thread jj
Pourquoi faire simple quand on peur faire compliqué? Revisiting this thread. Provided jq in in your PATH, my convoluted applescript script could be replaced by this simple text filter:

Re: Need explanation of REGEX code

2021-07-31 Thread jj
Hi Howard, Here is a commented version of your regular expression. (?x)(?# Allow whitespace and comments. ) ( (?# Opening of capture 1. ) . (?# Any single character.

Re: Need explanation of REGEX code

2021-07-31 Thread jj
Just seen there are some non digits in your input. Then use: (\([^\)]*\)|.) On Saturday, July 31, 2021 at 7:14:01 PM UTC+2 jj wrote: > Hi Howard, > > Here is a commented version of your regular expression. > > (?x)(?# Allow whitespa

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

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

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

Re: HTML syntax checking warnings

2021-09-28 Thread jj
Hi Alain, Those warnings are probably reporting that your document has unclosed "" tags (missing ""). You might try to have Tidy add the missing "" for you with: menu Markup > Tidy > Clean Document After running the command and *before saving the document*, you can check the

Re: Add text to beginning and end of file, using a Textfactory?

2021-09-20 Thread jj
Hi Adam, Building on Rich's answer, you could use the Canonize functionality here. (Quoted from the User Manual) Canonize This command allows you to perform batch search and replace operations which are governed by a pre-defined file. The transformation file is itself a list of paired search

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

2021-10-05 Thread jj
Using AppleScript to create HTML templates is an option and Christopher's example is excellent in that regard. BBEdit also offers some powerful tools to create/use customizable HTML templates with AppleScript placeholders. Check the BBEdit manual for: • Chapter 11: BBEdit HTML Tools,

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

2021-10-05 Thread jj
rocessing), 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 La

Re: Is BBLMRunColors only a coded language module feature.

2021-08-26 Thread jj
Function Pattern works. Maybe there is a magic name or > something.  > > Thanks, > — Chris(topher)? > > > > On Aug 24, 2021, at 1:43 AM, jj wrote: > > > Hi Christopher, > > Here is a minimal Codeless Language Module for an hypothetical > "Christopher"

Re: AppleScript -1728 error with replace selection

2021-10-24 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: 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: 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: 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

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: 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"* simulate typewriter mode w

Re: Typewriter mode possible?

2021-11-24 Thread jj
orrect? > > 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 of

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

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.

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:

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

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

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

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

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

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: Create script that attaches to menu command 'Run' in #!

2021-07-16 Thread jj
; set vScriptPath to vDirectoryPath & "/build.sh" > > Can I write the contents of build.sh directly in the script? I was > wondering if I can skip making an extra shell script file in my project > folder. > > On Friday, July 16, 2021 at 2:49:35 AM UTC-5 jj w

Re: Create script that attaches to menu command 'Run' in #!

2021-07-16 Thread jj
Hi Venkat, This applescript might do what you want if I correctly understood your workflow: ```applescript try tell application "BBEdit" tell first window tell first document if not (its on disk) then error "BBEdit's front document is not saved on disk." end if set vName to (its name) as string

Re: XML linter?

2021-07-23 Thread jj
Did you try xmllint ? Check if it is installed on your setup by typing in the Terminal: which xmllint If it is not installed you can intall it from Homebrew. It's part of the libxml2 package. In Terminal type: brew install libxml2 HTH Jean Jourdain On Friday, July 23, 2021

Re: XML linter?

2021-07-24 Thread jj
with "*menu Text > Apply Text Filter > xmllint.sh"*. For more info on xmllint options, type in the terminal: man xmllint HTH Jean Jourdain On Saturday, July 24, 2021 at 12:31:06 AM UTC+2 kre...@kreme.com wrote: > On 2021 Jul 23, at 13:10, jj wrote: > > Did you

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;

  1   2   >