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

Reply via email to