> On Aug 22, 2021, at 22:58, David J <[email protected]> wrote:

> Since the end goal was to get the text so I could hard wrap it by removing 
> all line breaks first. Is there any easy way to add an additional hard wrap 
> on all open documents to the above script?

Hey 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, @Script, @BBEdit, @Remove, @Line, @Breaks, @Project, 
@Window
--------------------------------------------------------
property hardWrapWidth : 70
--------------------------------------------------------

tell application "BBEdit"
    
    set docList to text documents of project window 1
    
    repeat with theDoc in docList
        tell theDoc's text
            remove line breaks
            hard wrap width hardWrapWidth
        end tell
    end repeat
    
end tell

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


--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/E8AE427B-9FB4-4435-AC26-9545098D985A%40gmail.com.

Reply via email to