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

2021-08-22 Thread David J
Hi Chris, 

 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? Or is it possible to alter it so 
I could run hard wrap on all open documents as a second operation? Well 
beyond my understanding so really appreciate what you whipped up there.

With respect, David
On Sunday, August 22, 2021 at 3:04:45 PM UTC-7 listmei...@gmail.com wrote:

> On Aug 21, 2021, at 20:07, David J  wrote:
>
>
> If I have multiple files open, can I remove line breaks from them all at 
> once? I've selected all open documents that are in the side tabs, but the 
> remove line breaks option is greyed out. 
>
> --
>
> Hey David,
>
> You can do 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, @Remove, @Line, @Breaks, @Project, 
> @Window
> 
>
> *tell* *application* "BBEdit"
>
> 
> *set* docList *to* *text documents* *of* *project window* 1
>
> 
> *repeat* *with* theDoc *in* docList
> *tell* theDoc's *text* *to* *remove line breaks*
> *end* *repeat*
>
> 
> *end* *tell*
>
> 
>
> Note that this works only on documents open in the front project window.
>
> The script can be altered to operate on any open document.
>
> --
> Best Regards,
> Chris
>
>
>

-- 
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: 
--- 
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/fb00ffbc-7e6d-4f64-a893-5f4640937e67n%40googlegroups.com.


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

2021-08-22 Thread Christopher Stone
> On Aug 21, 2021, at 20:07, David J  wrote:
> 
> If I have multiple files open, can I remove line breaks from them all at 
> once? I've selected all open documents that are in the side tabs, but the 
> remove line breaks option is greyed out. 

Hey David,

You can do 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, @Remove, @Line, @Breaks, @Project, 
@Window


tell application "BBEdit"

set docList to text documents of project window 1

repeat with theDoc in docList
tell theDoc's text to remove line breaks
end repeat

end tell



Note that this works only on documents open in the front project window.

The script can be altered to operate on any open document.

--
Best Regards,
Chris


-- 
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: 
--- 
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/66EFA0DB-CCBC-4888-8939-4EB6C076247A%40gmail.com.


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

2021-08-22 Thread Greg Raven
I'll bet you could create a Text Factory that does this, although I haven't 
tried it myself.

On Saturday, August 21, 2021 at 6:07:07 PM UTC-7 David J wrote:

> Quick additional questions:
>
> If I have multiple files open, can I remove line breaks from them all at 
> once? I've selected all open documents that are in the side tabs, but the 
> remove line breaks option is greyed out. 
>
> Is this something that I need to do some kind folder search/multi-file 
> search and grep? They are all in the same folder.  I'm assuming the bulk 
> edit operation to hard wrap text is similar to doing remove line breaks in 
> bulk?
>
> I've searched in the manual for bulk edit operation and the faq and I 
> clearly must not know the correct wording for this. Thank you for any 
> pointers
>
> On Thursday, August 19, 2021 at 11:01:34 AM UTC-7 David J wrote:
>
>> Oops, apparently learning Google groups too and sent a response to Rich 
>> private. 
>>
>> "Better to keep this on the group. :-)
>> Once it's unwrapped you can turn on Soft Wrap, or use Hard Wrap to reflow 
>> it to a specific width."
>>
>> This worked, thanks!
>>  
>>
>> On Thursday, August 19, 2021 at 10:18:00 AM UTC-7 sie...@barebones.com 
>> wrote:
>>
>>> On 19 Aug 2021, at 13:16, David J wrote: 
>>>
>>> > Hello, 
>>> > 
>>> > I've got a bunch of files that were cleaned up so they are just text. 
>>> The 
>>> > text looks fine, except I can't for the life of me figure out how to 
>>> get it 
>>> > to fill up horizontal space so I can read them like a pdf/document. 
>>> I've 
>>> > played around with hard/soft wrap options for hours and the text still 
>>> > stays in a skinny horizontal format. Can someone give me a pointer how 
>>> to 
>>> > reformat the text (in bulk) so it fits the page width? 
>>>
>>> "Remove Line Breaks" on the Text menu ought to do the job. 
>>>
>>> R. 
>>>
>>>
>>> -- 
>>> Rich Siegel Bare Bones Software, Inc. 
>>>   
>>>
>>> Someday I'll look back on all this and laugh... until they sedate me. 
>>>
>>

-- 
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: 
--- 
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/a5da0c3c-af06-445c-86b8-d6403ef0c10en%40googlegroups.com.