Working example of #SCRIPT# place holder in clipping

75 views
Skip to first unread message

Gary Ash

unread,
May 19, 2024, 3:50:19 PMMay 19
to BBEdit Talk
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

jj

unread,
May 22, 2024, 4:40:23 AMMay 22
to BBEdit Talk
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

Gary Ash

unread,
May 23, 2024, 3:29:26 PMMay 23
to BBEdit Talk
This doesn't seem to work. is there some sort of permission that has to be setup?
Reply all
Reply to author
Forward
0 new messages