Re: Clipping selection with multiple lines - add markdown quote?

2024-05-22 Thread Rich Siegel
On 22 May 2024, at 11:03, Craig Heilman wrote:

> I’m trying to configure a clipping to add the markdown quote “> “ to the 
> selection whether the selection is a single line or multiple lines.
>
> Examples:
>
> Single line selection
>
> becomes
>
>> Single line selection
>
> Selection line 1
> Selection line 2
> Selection line 3
>
> becomes
>
>> Selection line 1
>> Selection line 2
>> Selection line 3
>
> Is this possible with a clipping or do I need to use something like 
> Prefix/Suffix Lines instead?

Text => Increase Quote Level will probably do what you need.

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 believe that the application isn't working correctly, please email 
"supp...@barebones.com" rather than posting here. Follow @bbedit on Mastodon: 

--- 
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/6615D92B-D7FE-4764-B10F-ADEEDE835654%40barebones.com.


Clipping selection with multiple lines - add markdown quote?

2024-05-22 Thread Craig Heilman
I’m trying to configure a clipping to add the markdown quote “> “ to the 
selection whether the selection is a single line or multiple lines.

Examples:

Single line selection

becomes

> Single line selection

Selection line 1
Selection line 2
Selection line 3

becomes

> Selection line 1
> Selection line 2
> Selection line 3

Is this possible with a clipping or do I need to use something like 
Prefix/Suffix Lines instead?

Thanks,

Craig

--
Craig Heilman
Bugaboo Software



-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or believe that the application isn't working correctly, please email 
"supp...@barebones.com" rather than posting here. Follow @bbedit on Mastodon: 

--- 
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/2A7DDF90-D83C-4F48-A15F-BFDFBB5EB40A%40bugsoft.com.


Re: Working example of #SCRIPT# place holder in clipping

2024-05-22 Thread jj
Hi Gari,

Use this script for a 90 characters line width:

*tell* *application* "BBEdit"

*set* vCount *to* 91 - (startColumn *of* selection)

*set* vTxt *to* ""

*if* vCount > 0 *then*

*repeat* vCount *times*

*set* vTxt *to* vTxt & "*"

*end* *repeat*

*end* *if*

*return* vTxt

*end* *tell*



name it *line-of-asterisk.scpt* and place it in the *same folder* as the 
clipping.

And use this clipping with just the filename:

#SCRIPT line-of-asterisk.scpt#

See BBEdit 15.1 manual p. 336.

HTH

Jean Jourdain

On Sunday, May 19, 2024 at 9:50:19 PM UTC+2 Gary Ash wrote:

> I've got an AppleScript that I'm trying to run from a clipping but it 
> doesn't seem to work.
> The script does work from the script editor
>
> #SCRIPT /Users/garyash/Library/Application 
> Support/BBEdit/Scripts/line-of-asterisk.scpt #
>
> line-of-asterisk.scpt
>
> *tell* *application* "BBEdit"
>
> *set* theLineNumber *to* ((*startLine* *of* *selection*) *of* *text 
> window* 1)
>
> *set* theColumnNumber *to* ((*startColumn* *of* *selection*) *of* *text 
> window* 1)
>
> *set* txt *to* ""
>
> *repeat* (90 - theColumnNumber) *times*
>
> *set* txt *to* (txt & "*")
>
> *end* *repeat*
>
> *set* *selection* *to* txt
>
> *tell* *text* 1 *of* *window* 1
>
> *select* *insertion point* *after* *line* theLineNumber
>
> *end* *tell*
>
> *end* *tell*
>
>
> i did a chmod +x in case that was it
>
> thanks for any help
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or believe that the application isn't working correctly, please email 
"supp...@barebones.com" rather than posting here. Follow @bbedit on Mastodon: 

--- 
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/17872de5-0d38-47a2-b5e6-74575143d7c8n%40googlegroups.com.