Re: Text Factory Equivalent for BBEdit: Text: Remove Line Breaks?

2023-05-24 Thread Christopher Stone
ac and BBEdit ( and Keyboard Maestro :). -Chris -------- # Auth: Christopher Stone # dCre: 2023/05/24 18:30 # dMod: 2023/05/24 18:30 # Appl: BBEdit, System Events # Task: Run a Specific Text Factory and ‘remove line breaks’ on the Front Document

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

2023-05-14 Thread Christopher Stone
> On May 14, 2023, at 11:29, 'Andy Nickless' via BBEdit Talk > mailto:bbedit@googlegroups.com>> wrote: > > Something that I've been unable to find out is how to skip searching > something which already contains a simple pattern: > For instance, to find a number consisting 1-3 digits I use (\d{1,

Re: Include file name in grep/extract results?

2023-05-10 Thread Christopher Stone
> On May 07, 2023, at 14:17, severdia wrote: > > I have a lot of XML files and I'd like to grep a string and use Extract to > copy that string from each file to a single CSV file. Is there a pattern for > including the filename the strong was extracted from in the results? My goal > is a singl

Re: How to show number of corrections in bbedit?

2023-04-24 Thread Christopher Stone
> On Apr 24, 2023, at 13:04, Omar KN wrote: > > This was already asked some years ago, now after migrating to a new computer > - - > > when doing any FIND & "replace" action, where is the setting which allows the > users to see the number of corrections/replacements? Hey Omar, Save this URL

Re: Capturing multiple variables in regular expression

2023-03-22 Thread Christopher Stone
Here's a Perl filter that will do the job. -Chris #!/usr/bin/env perl -0777 -nsw # ---- # Auth: Christopher Stone # dCre: 2023/03/22 16:51 # dMod: 2023/03/22 16:51 # Task: Reformat Data for Use in a Database. # Tags: @ccstone, @Shell

Re: Need help simplifying apple script with grep

2023-03-20 Thread Christopher Stone
On Mar 19, 2023, at 15:17, Mathias wrote: > OK folks, I feel like I'm nearly there, but I have a small outstanding issue > that perhaps you can find it in your heart to help me with. Hey Mathias, What about something like this? ("[^"]+?") = "(.+?)"; -Chris -- This is the BBEdit Talk publi

Re: Need help simplifying apple script with grep

2023-03-18 Thread Christopher Stone
On Mar 17, 2023, at 09:29, Bruce Van Allen wrote: > Yes, double escapes are needed. As handy as Applescript is, quoting is a > major pain point. Not if you use Script Debugger . SD has a “Paste as String Literal” command that automates the double-quoting as necessary

Re: Scripting a Find, then doing a second Find, searching in the first Find's results

2023-02-17 Thread Christopher Stone
in/env perl -sw # -- # Auth: Christopher Stone # dCre: 2012/11/27 08:12 # dMod: 2023/02/17 12:43 # Task: Encode Spaces in Text Selection for a Given Pattern. # Tags: @ccstone, @Shell, @Script, @Encode, @Spaces, @RegEx #

Re: Scripting a Find, then doing a second Find, searching in the first Find's results

2023-02-17 Thread Christopher Stone
On Feb 16, 2023, at 23:48, Bruce Van Allen wrote: > Chris, did you mean: > $newSubject =~ s!\h!\%20!g; > rather than > $newSubject =~ s!\h!\$20!g; Hey Bruce, Yes indeed. Thanks for catching my mistake. :-) -- Take Care, Chris -- This is the BBEdit Talk public discussion group. If you have

Re: Scripting a Find, then doing a second Find, searching in the first Find's results

2023-02-16 Thread Christopher Stone
will be replaced with STDOUT. Something like this should suffice, and compared to AppleScript it will be lightning quick. #!/usr/bin/env perl -sw # -- # Auth: Christopher Stone # dCre: 2012/11/27 08:12 # dMod: 2023/02/16 23:18 # Task: Encode

Re: How to run N times a Text Factory?

2022-12-03 Thread Christopher Stone
> On Dec 02, 2022, at 07:42, Francisco Hirsch wrote: > > I have a Text Factory that I have to run N times on the same text. > ... > Is there a way that can run it N times or, even better, UNTIL there are no > changes? Hey Francisco, Text Factories have no method of looping, so you'll probably

Re: Get the result of a replace in AppleScript

2022-10-14 Thread Christopher Stone
> On Sep 26, 2022, at 08:22, Lionel wrote: > > AppleScript is not really a friend of regex ;-) You have to test the text to > transform with BBEdit and then translate it into AppleScript string to > incorporate it into the script. > > And sometimes it doesn't work, for example with \x20{6}

Re: Get the result of a replace in AppleScript

2022-09-21 Thread Christopher Stone
thing like this: ---- # Auth: Christopher Stone # dCre: 2022/09/21 10:00 # dMod: 2022/09/21 10:00 # Appl: BBEdit # Task: Return the Number of Processed Lines. # Libs: None # Osax: None # Tags: @Applescript, @Script, @BBEdit, @Processed, @Lines

Re: File links/URLs within BBEdit documents

2022-01-15 Thread Christopher Stone
> On Jan 12, 2022, at 11:50, jj wrote: > An easy way to get the URI of a document from the finder on macOS Monterey: This is easy enough to automate... -Chris # Auth: Christopher Stone # dCre: 2022/01/15 18:42 # dMod: 2022/01/15

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

2022-01-09 Thread Christopher Stone
regular expression to split the text records. The case of the split-string in insensitive and is also standardized in the file. -- Best Regards, Chris #!/usr/bin/env perl # - # Auth: Christopher Stone # dCre:

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

2022-01-07 Thread Christopher Stone
> On Jan 06, 2022, at 15:32, David G Wagner wrote: > I made mods to your code. I was not as clear as I should have been on > explanation desired results. Hey David, Using your input data sample my script exactly replicates your sample of desired output data format... Your code does not work

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

2022-01-06 Thread Christopher Stone
Hey Chris, This fails on my Mojave system with the stock `awk`. #Start#Start#Start# 2 In the beginning, God created the heavens and Xxccx #Start#EndOfGen#Start# #Start#Start#Start# 6 Thus the heavens and the earth were finished, Xxxx #Start#EndOfGen#Start# #Start#Start#Start# 10 Now the

Re: Need to increment a counter for chapter count

2022-01-06 Thread Christopher Stone
~/Library/Application Support/BBEdit/Text Filters/ #!/usr/bin/env perl -sw # ----- # Auth: Christopher Stone # dCre: 2022/01/06 06:35 # dMod: 2022/01/06 06:35 # Task: Number Lines Based On A Condition. # Tag

Re: Executing Multiple Saved Regular Expressions

2022-01-06 Thread Christopher Stone
On Jan 05, 2022, at 17:03, Peter Kaufman wrote: > I have stored over 2 dozen regular expressions stored under the "g" in > Find/Replace. > I'd like to run 6 of them sequentially against a file. Is there a way to do > this? Hey Peter, While Text Factories work well, I tend to use AppleScript f

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

2021-12-30 Thread Christopher Stone
On Dec 30, 2021, at 13:49, Lorenz Groth wrote: > What I want to learn is how to produce a simple list of numbered word such as > word01 > word02 > word03 > word04 Hey Lorenz, The most direct method is probably to use a text filter like so: #!/usr/bin/env bash seq -w 200 | sed s'!^!Word!' T

Re: How to have \D ignore newline character?

2021-12-13 Thread Christopher Stone
> On Dec 12, 2021, at 23:38, Tim A wrote: > Deepening the challenge, the phone numbers are actually in the second of > three columns separated by tabs. If I can get the phone numbers stripped I > can then impose a uniform format on them. Hey Tim, Find: [(]?(\d{3})\D*(\d{3})\D*(\d{4}) Replace

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

2021-12-07 Thread Christopher Stone
> On Dec 07, 2021, at 17:50, Pavel wrote: > > Would anyone please know what must contain grep so that the first words of > the sentence do not appear in the search results? Hey Pavel, Tom's idea is simpler, but you can do this: Find: (?https://twitter.com/bbedit> --- You received this mess

Re: Counting Text Strings In a Directory

2021-12-07 Thread Christopher Stone
t it then you need to do something like this: # Auth: Christopher Stone # dCre: 2021/12/07 22:17 # dMod: 2021/12/07 22:17 # Appl: BBEdit # Task: Count the Number of Files Containing a Search String – Recursive-File-Search # Libs: None # O

Re: Custom sequencing

2021-12-06 Thread Christopher Stone
On Dec 06, 2021, at 09:31, Maciek Schejbal wrote: > I have 250 images to be shown in the slide show. After I copy the paths, > would anybody have a way to automate BBEdit to continue numbering the > following sequence? Hey Maciek, Please provide an accurate sample of the before state of your c

Reposition the Selection Toward the Top of the Editing Window

2021-11-24 Thread Christopher Stone
ht that was pretty slick but a little bit of overkill – I've since edited hundreds of thousands of lines of code and learned otherwise. -- Best Regards, Chris ---- # Auth: Christopher Stone { Building upon work by Jean Jourdain } # dCre

Re: Search & Replace

2021-11-15 Thread Christopher Stone
> On Nov 15, 2021, at 15:18, R B COHEN wrote: > > 1 _GCID 94D0C28F-7346-4AC7-96D1-147294BADAF1 Hey R B, Is this the start of the line? Are these always _GCID numbers? Is the hyphenated alphanumeric string always 36 characters? Something like this: Find: (?-i)^.*[0-9A-Z]{8}-[0-9A-Z]{4}-[0-9

Re: The incredible shrinking selections.

2021-11-08 Thread Christopher Stone
> On Nov 08, 2021, at 00:14, Christopher Waterman wrote: > > If I select every occurrence of "whatsit" through which ever means. > > ... > > Then run this AppleScript. > > AppleScript: > tell window 1 of application "BBEdit" > set stuff to get selection > end tell > > It returns a list

Re: Find and Replace multiple queries at once

2021-11-06 Thread Christopher Stone
> On Nov 05, 2021, at 22:43, Pu Koh wrote: > Thanks all. I shall look into the suggestions. > Here's what I'm trying to do. > I'm creating HTML 5 banners, and need to inject code for the click tags. > The code looks like this: Hey There, Here's a super basic proof-of-concept. -- Best Regards, C

Re: Find and Replace multiple queries at once

2021-11-05 Thread Christopher Stone
> On Nov 05, 2021, at 06:00, Pu Koh wrote: > > Is there a function to run multiple find and replace patterns instead of > doing it one at a time? Hey There, Personally I would most often use a Text Filter and a little Perl, although it depends upon the context. (See appended script. See “Te

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

2021-10-28 Thread Christopher Stone
> On Oct 28, 2021, at 22:28, Nosadge > wrote: > > I'm defining lines as anything with a number infant of it. I'm new to this > editor, and use it to edit transcripts, so my jargon will probably be > incorrect. Hey Nosadge, Did you mean a number in front of the lin

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

2021-10-28 Thread Christopher Stone
> On Oct 28, 2021, at 17:10, Nosadge wrote: > > Does anyone know a command/script/grep to make sure the first letter of every > line is capitalized? Hey There, How are you defining lines? Line one. Line two. ... In that case Fletcher's regex works fine, although you might prefer to run it f

Re: Easiest way to replace all matches

2021-10-21 Thread Christopher Stone
t of AppleScript. -- Take Care, Chris -------- # Auth: Christopher Stone # dCre: 2021/10/21 10:33 # dMod: 2021/10/21 10:33 # Appl: BBEdit # Task: Enclose All Instances of the Selected Word with Curly Braces. # Libs: None # Osax: None # Tags: @A

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

2021-10-10 Thread Christopher Stone
> On Oct 07, 2021, at 23:11, Sonic Purity wrote: > Note: i write my stories in TE—that’s non-negotiable. Hey Sonic, Agh... At least take a look at Jedit Ω (1,840 Yen ~ $16.00 USD). http://www.artman21.com/en/jeditOmega/ It will do what TextEdit will do and a whole lot more. You have to tweak

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

2021-10-04 Thread Christopher Stone
--------- # Auth: Christopher Stone # dCre: 2021/10/04 20:07 # dMod: 2021/10/04 20:07 # Appl: BBEdit # Task: Create a New HTML Document Using a Template File. # Libs: None # Osax: None # Tags: @Applescript, @Script, @ASObjC, @BBEdit, @

Re: Split View possible?

2021-09-27 Thread Christopher Stone
can use AppleScript. # Auth: Christopher Stone # dCre: 2021/09/27 18:24 # dMod: 2021/09/27 18:24 # Appl: BBEdit # Task: Set Bounds of Windows 1 and 2. # Libs: None # Osax: None # Tags: @Applescript, @Script, @BBEdit, @Window,

Re: GEDCOM manipulation for one text tag (database transfer related)

2021-09-18 Thread Christopher Stone
> On Sep 18, 2021, at 15:19, Roger Moffat wrote: > > Thanks for this - I recommended Ryan to the geniuses on this list. I figured > it would be possible, but didn’t know where to begin to think about it. > > Once the text of the NOTE tag has been moved to the 1 OCCU line, the entire > line >

Re: GEDCOM manipulation for one text tag (database transfer related)

2021-09-18 Thread Christopher Stone
> On Sep 18, 2021, at 14:19, Ryan Noyes wrote: > Seeking workflow advice for wrangling a genealogical GEDCOM file in such a > way that content normally appearing within the red box in this screenshot, > instead populates where the green box is. Hey Ryan, You did a good job explaining the probl

Re: Find followed by many lines of arbitrary HTML through next but exclude the second

2021-09-15 Thread Christopher Stone
> On Sep 15, 2021, at 00:51, ctfishman wrote: > > I tried doing this with just a regular expression but couldn't figure out how. Hey There, Yeah, you couldn't automate the whole process with regex alone. > I was however able to do it quite easily with a text filter... > >

Re: Find followed by many lines of arbitrary HTML through next but exclude the second

2021-09-15 Thread Christopher Stone
> On Sep 14, 2021, at 16:57, Sonic Purity wrote: > Re-reading the Grep help file with BBEdit, i thought lookahead might help. I > tried: > > ([\s\S]+?)(?) > Hey There, You miswrote your lookahead-assertion. This: > ([\s\S]+?)(?) > Should look like this: ([\s\S]+?)(?=) This is fine, ex

Re: Need way of counting number of occurrences of names

2021-09-09 Thread Christopher Stone
> On Sep 09, 2021, at 23:15, Bruce Van Allen wrote: > > Kerri's method was correct! Indeed. It's a great example of how useful a very simple regular expression can be. :-) -- Best Regards, Chris -- This is the BBEdit Talk public discussion group. If you have a feature request or need tec

Re: Need way of counting number of occurrences of names

2021-09-08 Thread Christopher Stone
is one or more lines of text: Hey Howard, This is a bit of a chore but not uber difficult using a Perl text filter. -- Best Regards, Chris #!/usr/bin/env perl -0777 -nsw # ----- # Auth: Christopher Stone # dCre: 2021/09/08 15:31 # dMod: 2

Re: Save find/replace match to new file

2021-09-01 Thread Christopher Stone
> On Sep 01, 2021, at 09:07, Matthew Montgomery wrote: > > Your trusty script worked perfectly and has for sure saved me a nice chunk of > time. I really appreciate you sharing this. Hey Matthew, Super! And you're welcome. -- Best Regards, Chris -- This is the BBEdit Talk public discussi

Re: Save find/replace match to new file

2021-08-31 Thread Christopher Stone
is ---- # Auth: Christopher Stone # dCre: 2021/08/31 18:49 # dMod: 2021/08/31 18:49 # Appl: BBEdit # Task: Explode TSV Document into One YAML File Per Line. # Libs: None # Osax: None # Tags: @Apple

Re: script/text filter advice

2021-08-30 Thread Christopher Stone
#x27;s more complicated to use that information in the shell than with AppleScript. Here's your basic AppleScript for the task: ---- # Auth: Christopher Stone # dCre: 2021/08/30 04:02 # dMod: 2021/08/30 04:02 # Appl: BBEdit # Task: Working with

Re: Bespoke preferences

2021-08-29 Thread Christopher Stone
ely BBEdit > has a way of doing this that I have missed. Hey Michael, You can customize BBEdit a great deal with AppleScript. Run this from Apple's Script Editor.app to see how it works. -------- # Auth: Christopher Stone # dCre: 2021/08/2

Re: How to format this text so it expands and fits page width?

2021-08-24 Thread Christopher Stone
> On Aug 24, 2021, at 10:39, David J wrote: > > Oh, one last thing. Is there a save all command available after doing this? Hey David, AppleScript can do many things... # Auth: Christopher Stone # dCre: 2021/08/22 16:43 # dMod

Re: How to format this text so it expands and fits page width?

2021-08-23 Thread Christopher Stone
David, Sure. ---- # Auth: Christopher Stone # dCre: 2021/08/22 16:43 # dMod: 2021/08/23 12:27 # Appl: BBEdit # Task: Remove Line Breaks from Text Documents of Project Window 1. # : Then Hard Wrap to the Given Length. # Libs: None # Osax: None # Tags: @Applescript, @Scr

Re: How to format this text so it expands and fits page width?

2021-08-22 Thread Christopher Stone
something like this: ---- # Auth: Christopher Stone # dCre: 2021/08/22 16:43 # dMod: 2021/08/22 16:43 # Appl: BBEdit # Task: Remove Line Breaks from Text Documents of Project Window 1. # Libs: None # Osax: None # Tags: @Applescript, @Script, @BBEdit, @Re

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

2021-08-19 Thread Christopher Stone
On Aug 19, 2021, at 12:20, David J wrote: > I have a long text that I tagged, I'd like to move those tags up to the end > of the last line they are under: Hey David, I'm thinking something like this: Find: \s+((?:#\w+\h*)+) Replace: “ \1” ** Without the quotes. -- Best Regards, Chris --

Re: Copying grep match to clipboard

2021-08-15 Thread Christopher Stone
stand your task is really just a simple find/replace. AppleScriptified: ------- # Auth: Christopher Stone # dCre: 2021/08/15 09:01 # dMod: 2021/08/15 09:01 # Appl: BBEdit # Task: Copy text from (the beginnging o

Re: Set selection point to next line in AppleScript

2021-08-05 Thread Christopher Stone
> On Aug 05, 2021, at 05:15, Rainer Krug wrote: > > I have the following AppleScript to execute het selected text in R and return > the focus to BBEdit: > ... > Now I would like to set the cursor in BBEDit to the next line after the > selected text ore line it is in. Hey Rainer, You can do so

Re: BBEdit 14.0.1 – Scroll Text Up Past Bottom of Window

2021-08-04 Thread Christopher Stone
> On Aug 02, 2021, at 04:39, Tom Robinson wrote: > > I think you missed the annotated screenshot Rich attached :] Hey Tom, Eh? Hmm... Sure enough. I see it in the group online. I was sure the image was missing from my copy of the message in Mail (Mojave), but I just checked – and it's the

Re: BBEdit 14.0.1 – Scroll Text Up Past Bottom of Window

2021-08-02 Thread Christopher Stone
> On Aug 02, 2021, at 03:11, Jan Erik Moström wrote: > > On 2 Aug 2021, at 10:04, Christopher Stone wrote: > >> It's _not_ listed in the expert settings for BBEdit 14.x. > > Open preferences, select "Editing", about 2/3 down "Extra vertical space&q

Re: BBEdit 14.0.1 – Scroll Text Up Past Bottom of Window

2021-08-02 Thread Christopher Stone
Hey Rich, Well, where? It's not listed in the expert settings for BBEdit 14.x. https://www.barebones.com/support/bbedit/ExpertPreferences.html -- Best Regards, Chris > On Aug 01, 2021, at 20:25, Rich Siegel wrote: > > On 1 Aug 2021, at 18:47, Christopher Stone wrote: &

Re: BBEdit 14.0.1 – Scroll Text Up Past Bottom of Window

2021-08-01 Thread Christopher Stone
> On Aug 01, 2021, at 18:42, Christopher Waterman wrote: > > I think it’s. > > defaults write com.barebones.bbedit ExtraSpaceInTextViews -bool YES Hey Christopher, That didn't work for me, but it helped me do some sleuthing. There is NO “ExtraSpaceInTextViews” pref in the currently listed ex

BBEdit 14.0.1 – Scroll Text Up Past Bottom of Window

2021-08-01 Thread Christopher Stone
Hey Folks, BBEdit 12.x allowed the user to scroll text up past the bottom of the window, so you could conveniently position the cursor in your comfort zone without having to add blank lines to the end of your text. I'm looking in the prefs and expert prefs and can't find the setting. Could som

Re: Need to extract all digits from string

2021-07-29 Thread Christopher Stone
On Jul 29, 2021, at 00:19, Tim A wrote: > How to not include the brackets as Howard asked? I figure it involves > non-capture but it eludes me. Eh? Hmm. I must have been tired. Find: \[(\d+)\]|(\d) Replace: \1\2\n -- Best Regards, Chris -- This is the BBEdit Talk public discussion group

Re: Need to extract all digits from string

2021-07-27 Thread Christopher Stone
Hey Howard, What exactly do you mean by “regmatches”? Find: (\d|\[\d+\]) Replace: \1\n -- Best Regards, Chris > On Jul 27, 2021, at 14:41, Howard > wrote: > > I have a string of numbers like this: > > "12[11]4567[10]0" > > The string may be longer or shor

Re: Script help - Convert untitled text to notes

2021-07-23 Thread Christopher Stone
end commenting-out close theDoc until you're confident the script works as intended. -- Best Regards, Chris -------- # Auth: Christopher Stone # dCre: 2021/07/23 10:57 # dMod: 2021/07/23 10:57 # Appl: BBEdit, System Events # Task: Convert Unsaved

BBEdit 14 Debuts

2021-07-19 Thread Christopher Stone
> On Jul 19, 2021, at 13:39, Rich Siegel wrote: > We are pleased to announce the release and immediate availability of BBEdit > 14.0. This major upgrade adds over a hundred new features, improvements to > existing features, and minor refinements. Color me impressed... Thanks Rich! -- Take Ca

Re: TextFactory and then AppleScript works; AppleScript in TextFactory doesn't

2021-07-07 Thread Christopher Stone
menu (or FastScripts <https://www.red-sweater.com/fastscripts/>, Keyboard Maestro <https://www.keyboardmaestro.com/main/>, or another AppleScript runner app.) Something like this: ------- # Auth: Christop

Re: Searching an html tag with Applescript and BBEdit

2021-06-28 Thread Christopher Stone
On 06/29/2021, at 00:37, Murat mailto:myi...@gmail.com>> wrote: > set result to (find "" searching in ¬ > (alias "full HFS path to my file") ¬ > options {starting at top:true} with selecting match) > > if (found of result) then . > > Script debugger tells me,

Re: Scripts

2021-06-28 Thread Christopher Stone
e a text doc and another to replace certain text within a text doc. Hey Paul, Replacing text with AppleScript is easy enough once you know how: ------- # Auth: Christopher Stone # dCre: 2021/06/28 21:28 # dMod:

Re: AppleScript to make window wide enough to not scroll?

2021-06-26 Thread Christopher Stone
On 06/26/2021, at 20:32, TJ Luoma mailto:luo...@gmail.com>> wrote: > I’m not sure if that’s something that can easily be changed (just to make the > scrollbar disappear) but if not that’s really a minor nit. Tweak one of these properties until its wide enough: property gutterWidth : 64 propert

Re: Looking for Preference: Prevent Scrollbar possible ?

2021-06-26 Thread Christopher Stone
On 06/26/2021, at 04:50, Wastle Smith mailto:wastlesm...@gmail.com>> wrote: > With that I want to prevent horizontal scrolling (e.g. due to an over-size. > long line ). Instead I want that the window is resized. Great enough to > prevent that type of scrolling (which often then hides the beginni

Re: AppleScript to make window wide enough to not scroll?

2021-06-26 Thread Christopher Stone
--- # Auth: Christopher Stone { Kudos to Shane Stanley for generous help with ASObjC } # dCre: 2018/09/16 22:24 # dMod: 2021/06/26 19:08 # Appl: BBEdit # Task: Resize width of front BBEdit window according to longest line and

Re: Stumped on this one

2021-06-15 Thread Christopher Stone
On 06/15/2021, at 18:28, @lbutlr mailto:krem...@kreme.com>> wrote: > I have a file that has a few hundred lines, 77 of which are a HTML/XML style > date element > > Tue, 15 Jun 2021 17:12:26 -0600 > > I have another files that has 77 date lines in the same format. Everything is > different dat

Re: Extract number within parentheses using GREP

2021-06-07 Thread Christopher Stone
On 06/07/2021, at 14:53, Christopher Stone <listmeister...@gmail.com> wrote:This becomes terribly tedious when you do it all by hand, so I wrote you an example Text Factory.Install here:~/Library/Application Support/BBEdit/Text Filters/Text Factories/You have to run it from the Text > A

Re: Extract number within parentheses using GREP

2021-06-07 Thread Christopher Stone
On 06/03/2021, at 09:46, Howard wrote:Chris, what you wrote is very helpful.To get the Grep results not enclosed in parentheses, I used the Replace pattern `\2` with this Search pattern:\d*(\((\d+)\))\d*but that resulted in these numbers:10161011Hey Howard,That can't be ri

Re: Extract number within parentheses using GREP

2021-06-02 Thread Christopher Stone
On 06/01/2021, at 18:59, Howard mailto:leadwithlo...@gmail.com>> wrote: > To help me to understand better the Grep part of Neil's solution, can someone > provide me with the search pattern and the replace pattern to just find those > lines with numbers in parentheses and extract them without any

Re: Extract number within parentheses using GREP

2021-06-01 Thread Christopher Stone
On 06/01/2021, at 08:11, Howard mailto:leadwithlo...@gmail.com>> wrote: > I have a set of numbers. Within some of them is at least one number within > parentheses. I need to find all the lines containing numbers within > parentheses and extract those numbers. I also need to know which line they

Re: AppleScript to make window wide enough to not scroll?

2021-06-01 Thread Christopher Stone
in v13, but I haven't bothered to tweak it as yet. See the values for: gutterWidth gutterPad scrollbarWidth Adjust as needed. Enjoy. -- Take Care, Chris ------- # Auth: Christopher Stone { Kudos to Shane

Re: AppleScript to make window wide enough to not scroll?

2021-05-31 Thread Christopher Stone
On 05/30/2021, at 17:14, TJ Luoma mailto:luo...@gmail.com>> wrote: > Hi all, my name is TJ and I don't understand AppleScript, hence I come, > again, asking for help from those who do. > > I like to set "Soft Word Wrap" to "Window Width". > > But then I often find that I want to adjust the widt

Re: Two files in the same window

2021-05-27 Thread Christopher Stone
On 05/27/2021, at 11:16, Ron Catterall mailto:roncattera...@gmail.com>> wrote: > Heresy I know: BUT Supreme Text will do 2, 3 ...side by side same or > different files Hey Ron, Did you mean Sublime Text

Re: Handling dollar signs in search and replace

2021-05-27 Thread Christopher Stone
On 05/26/2021, at 21:42, Duncan Thorne mailto:duncan...@gmail.com>> wrote: > I just noticed that you too use T-E+. I sing the praises of it every day and > it's a big reason I'm still at Mojave, the last 32-bit compatible version of > the OS. I wonder what happened to Tom Bender, the guy behind i

Re: Handling dollar signs in search and replace

2021-05-26 Thread Christopher Stone
On 05/25/2021, at 23:19, Duncan Thorne mailto:duncan...@gmail.com>> wrote: > Here's a sample line from my script where things go wrong: > tell front text window's text > > replace "2021 > > \$" using " \$" options {search mode:grep, case sensitive:false, starting > at top:true} -- the idea bei

Re: Handling dollar signs in search and replace

2021-05-25 Thread Christopher Stone
On 05/25/2021, at 19:17, Duncan Thorne mailto:duncan...@gmail.com>> wrote: > I'm stumped when it comes to reformatting a text line that begins with a $ > symbol. I want to replace the preceding line's line break, followed by the > new line's $, with a tab-$. > For instance: > ... 2021 > $0.23 >

Re: Finding & replacing text with Applescript

2021-05-25 Thread Christopher Stone
practices. I'm using the top table on this page as my test data: https://material.angular.io/components/table/examples <https://material.angular.io/components/table/examples> -- Best Regards, Chris -------- # Auth: Ch

Re: Line breaks: How to avoid them?

2021-05-25 Thread Christopher Stone
On 05/25/2021, at 13:58, Duncan Thorne mailto:duncan...@gmail.com>> wrote: > At the end of each of my find-and-replace applescript lines, for massaging > text, the result includes an unwanted line break. Is there a way to avoid > this? Hey Duncan, What's your script? Please show an example of

Re: Finding & replacing text with Applescript

2021-05-24 Thread Christopher Stone
On 05/24/2021, at 21:44, Rich Siegel mailto:sie...@barebones.com>> wrote: > his is a good script. Some feedback: as a matter of best practices and future > proofing, avoid targeting windows (or elements of them). Hey Rich, Thanks for the feedback. Actually I often use this sort of construct:

Re: Finding & replacing text with Applescript

2021-05-24 Thread Christopher Stone
Do one regex-based find/replace on the document. - You can add more replace statements as needed. Enjoy. -- Best Regards, Chris -------- # Auth: Christopher Stone # dCre: 2021/05/24 21:24 # dMod: 2021/05/24 21:29 # Appl: BBEdit # Task: Copy Safa

Re: Grep find/replace numbers

2021-05-23 Thread Christopher Stone
On 05/22/2021, at 19:22, severdia mailto:sever...@gmail.com>> wrote: > Yes, you're right. I got it working, but for future reference here's what I > was trying to do...I have many of these elements: > > Macbeth5.15.1.64 > > Both and contain act/scene/line number info and either one other > th

Re: Grep find/replace numbers

2021-05-22 Thread Christopher Stone
On 05/22/2021, at 10:50, severdia mailto:sever...@gmail.com>> wrote: > I can't seem to figure out a way to find and replace some numbers using Grep. > This is what I have. > > 2.22.2.93 > > I have many cases where there are 3 numbers separated by two periods wrapped > in (like this: 2.2.309) a

Re: Automator actions and Grep: Extracting lines

2021-05-19 Thread Christopher Stone
On 05/19/2021, at 08:30, Miguel Perez mailto:maperezespin...@gmail.com>> wrote: > On a daily basis I get an XML file. This file contains information about some > dossiers. I need to extract two elements from each dossier: (1) a URL to > download associated images, and (2) the dossier's name. He

Re: Moving endnotes to inline

2021-05-14 Thread Christopher Stone
On 05/14/2021, at 14:04, Cooper Cavalier mailto:dstromber...@gmail.com>> wrote: > I have a text/html file which has thousands of endnotes. The file has the > inline endnote reference as [1], [2], [3], etc. which correspond to the > appropriate endnote. For the app publisher I am working for, th

Re: Need help accessing multiple files' content at the same time

2021-05-08 Thread Christopher Stone
On 05/07/2021, at 17:10, @lbutlr mailto:krem...@kreme.com>> wrote: > On 07 May 2021, at 05:32, Christopher Stone <mailto:listmeister...@gmail.com>> wrote: >> # Find files, concatenate their contents, send result to BBEdit. >> find -E . -type f \( ! -n

Re: Need help accessing multiple files' content at the same time

2021-05-07 Thread Christopher Stone
pts/ #!/usr/bin/env bash # ----- # Auth: Christopher Stone # dCre: 2021/05/07 06:07 # dMod: 2021/05/07 06:07 # Task: Recursively Concatenate Files in the Front Finder Window. # Tags: @ccstone, @Shell, @Script, @Concatenate

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

2021-04-27 Thread Christopher Stone
On 04/26/2021, at 18:37, David J mailto:futurevint...@gmail.com>> wrote: > I'm trying to take out any empty lines from a document and can't figure out > why it's not working. > > I'm adding the text, then selecting all then adding grep > > ^\s*?\r > > then replace all with nothing. I'm

Re: find first x of a ',' delimited set of numeric strings?

2021-04-27 Thread Christopher Stone
On 04/26/2021, at 12:53, Joel Braverman mailto:joeljbr...@gmail.com>> wrote: > have a few thousand of these: > '199','627','1151','1249','1557','1558','1565','1689','1693','1711','1770','1780' > > I want to break them up into subgroups as our SQL system chokes at > 4000 > items in a query. Hey

Re: Sorting transcripts

2021-04-25 Thread Christopher Stone
On 04/25/2021, at 00:34, @lbutlr mailto:krem...@kreme.com>> wrote: > On 19 Apr 2021, at 21:46, Christopher Stone <mailto:listmeister...@gmail.com>> wrote: >> use v5.010; > > Excellent script, but is this needed? And what are the consequences if you > have 5.

Re: Using BBEdit for markdown presentation?

2021-04-20 Thread Christopher Stone
On 04/20/2021, at 14:31, Tibor Páli mailto:palitiborlas...@gmail.com>> wrote: > Is TextsQuickLook.qlgenerator a script that you wrote, it is something > provided with Marked 2? > Tibor > >> I've got 3 apps on my system that include a Quick Look module for MarkDown. >> >> com.barebones.bbedit.mar

Re: Using BBEdit for markdown presentation?

2021-04-20 Thread Christopher Stone
On 04/20/2021, at 12:23, Tibor Páli mailto:palitiborlas...@gmail.com>> wrote: > So, if I force to open an .md file with Safari, it opens it as an un-rendered > markdown text file, just like BBEdit. > > I think Chrome can render markdown files. I my install and try. Hey Tibor, Take a good look

Re: Sorting transcripts

2021-04-19 Thread Christopher Stone
Hey James, I'm late to this party, but I wanted to see how fun it would be to do the job in Perl. It turned out to be really simple: #!/usr/bin/env perl -0777 -nsw # # Auth: Christopher Stone # dCre: 2012/

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

2021-04-19 Thread Christopher Stone
On 04/19/2021, at 09:21, Francisco Hirsch mailto:listas.hir...@gmail.com>> wrote: > I should have made my question and example clearer. > I give a clearer example: > > 1. THIS SOFTWARE IS PROVIDED “AS IS”, WITHOUT > 2. PERMISSION IS GRANTED TO ANYONE TO USE THIS Hey Francisco, In my script I've

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

2021-04-19 Thread Christopher Stone
On 04/19/2021, at 09:21, Francisco Hirsch mailto:listas.hir...@gmail.com>> wrote: > I should have made my question and example clearer. Hey Francisco, You can't do this job with a plain regular expression, because of the variability of the text. You'll have to use a script. How big is the doc

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

2021-04-19 Thread Christopher Stone
On 04/19/2021, at 08:13, jj mailto:goo...@mixio.com>> wrote: > Here is a BBEdit Text Filter in PHP that capitalizes the text of hyperlinks. Hey JJ, Your script is failing when encountering punctuation: Original: 1. THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT 2. PERMISSION IS GRANTED TO ANYONE T

Re: Can't launch BBEdit

2021-04-16 Thread Christopher Stone
On 04/16/2021, at 02:23, @lbutlr mailto:krem...@kreme.com>> wrote: > I added the BBEdit manual to my Books.app Library. Maybe I'll even remember > it's there the next time I am in desperate need, but I've been using BBEdit > for almost 20 years (yes, I'm a n00b) and this is the first time I coul

Re: Applescript - move to end of document

2021-04-14 Thread Christopher Stone
On 04/14/2021, at 11:28, Rich Siegel mailto:sie...@barebones.com>> wrote: > This should work: > > tell app "BBEdit" > activate > open file_path > select insertion point after last character of document 1 > end tell > > (It's best to always tar

Re: How to save out all my unsaved untitled files

2021-03-29 Thread Christopher Stone
a newer system I'd want to verify.) -- Best Regards, Chris -------- # Auth: Christopher Stone # dCre: 2016/10/18 03:00 # dMod: 2021/03/29 10:33 # Appl: BBEdit # Task: Save unsaved text documents and shell documents to a date-stamped folder in the Finder. # : The

Re: GREP pattern to replace the first element with a tab

2021-03-21 Thread Christopher Stone
. Why wait 8 seconds when instantaneous is available? -- Best Regards, Chris #!/usr/bin/env perl -sw # ----- # Auth: Christopher Stone mailto:scriptmeis...@thestoneforge.com>> # dCre: 2012/11/27 08:12 # dMo

  1   2   3   4   5   6   7   8   9   10   >