Auto increment applescript to number paragraphs in BBEdit
Posted: 2014-09-14 16:13:43
The BBEdit people kindly supplied me with a piece of AppleScript that auto-increments paragraph numbers in a document, where I have previously numbered all paragraphs with a caret: ^
The script changes the caret to 1, 2, 3, ...1,000, 1,001, 1,002, etc with no limit, sequentially incrementing the number by one each time.
Could Nisus provide a similar script? Here's the BBEdit one (the original has appropriate indents):
tell application "BBEdit"
activate
set i to 1
set continueSearch to true
select insertion point before line 1 of text window 1
repeat while continueSearch is true
set mySearch to find "^" searching in text 1 of text document 1 options {search mode:literal, wrap around:false} with selecting match
set continueSearch to found of mySearch
if continueSearch is true then
set selection to i as text
set i to i + 1
else
return
end if
end repeat
end tell
Thanks!
The script changes the caret to 1, 2, 3, ...1,000, 1,001, 1,002, etc with no limit, sequentially incrementing the number by one each time.
Could Nisus provide a similar script? Here's the BBEdit one (the original has appropriate indents):
tell application "BBEdit"
activate
set i to 1
set continueSearch to true
select insertion point before line 1 of text window 1
repeat while continueSearch is true
set mySearch to find "^" searching in text 1 of text document 1 options {search mode:literal, wrap around:false} with selecting match
set continueSearch to found of mySearch
if continueSearch is true then
set selection to i as text
set i to i + 1
else
return
end if
end repeat
end tell
Thanks!