> On May 24, 2023, at 07:16, Mark Mayberry <markmaybe...@gmail.com> wrote:
> 
> However, I cannot figure out which Text Factory command is the equivalent of 
> simply pressing  BBEdit Text (Menu) >> Remove Line Breaks.

Hey Mark,

Surprisingly there isn't one...

You have to roll-your-own via a RegEx, AppleScript-filter, or text-filter.

I tend to turn to AppleScript for this sort of thing.

Note how you can mix and match AppleScript and Text Factories. In this instance 
it's easy enough to employ BBEdit's own 'remove line breaks' command.

Glad you're enjoying the Mac and BBEdit ( and Keyboard Maestro :).

-Chris


--------------------------------------------------------
# Auth: Christopher Stone <scriptmeis...@thestoneforge.com>
# 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.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @System_Events, @Text-Factory, 
@Remove_Line_Breaks
--------------------------------------------------------

set textFactoryFile to "~/Library/Application Support/BBEdit/Text Filters/Text 
Factories/TEST.textfactory"
tell application "System Events" to set textFactoryFile to (POSIX path of disk 
item textFactoryFile)

tell application "BBEdit"
    set frontDoc to front text document
    apply text factory textFactoryFile to frontDoc
    tell frontDoc's text
        remove line breaks
    end tell
end tell

--------------------------------------------------------

-- 
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 here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/72A11FB2-C6FC-4D56-9431-B5DC03DCEBAE%40gmail.com.

Reply via email to