Discussion:
AppleScripting BBEdit...
Frank Mantek
2008-04-29 17:34:37 UTC
Permalink
I am trying my first AppleScript, out of necessity. I am trying to
create a report of "touched on" tasks in Omnifocus. So i get some
applescript template that let's me enumerate omnifocus items, and that
works fine. But i am having a hard time finding a simple script for
BBEdit that just let's me "add lines with that text" from AppleScript.
I find lot's of examples creating new docs with html from safari etc,
but something that gradually builds up a complete document, line by
line, i don't find....

Can someone point me to a sample (i love cut/copy/paste) or some "get
started" page on the web? I tried searching, but there is just too
much stuff to siff through.....

TiA

Frank
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Bill Verity
2008-04-29 21:26:39 UTC
Permalink
I found bbedit to get into, but here is a function that I have to
insert a line at the end of a file. The key is setting an insertion
point and then set the selection.

...
my ToBBEdit(aList, Short_Title)
...
--
-- Write out names in outline format
-- Indent is the number space to ident the line
--
on ToBBEdit(NextName, Title)
local blanks, nextLine
tell application "BBEdit"
tell front window
set blanks to characters 1 thru indent of "
"
set nextLine to blanks & NextName & " " & Title & return as Unicode text
select insertion point after last character
set selection to nextLine
end tell
end tell
return
end ToBBEdit
--
Good friends are hard to find, harder to leave, and impossible to forget.

Bill Verity - 814-865-4758 Fax: 814-863-7049
215A Computer Building - Information Technology Services, Penn State University
At the office - on my Mac, of course ;-)
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Frank Mantek
2008-04-30 14:27:12 UTC
Permalink
Thanks a lot, that actually got me going in the correct direction, and
i now have my "weekly report" script done...

Frank
Post by Bill Verity
I found bbedit to get into, but here is a function that I have to
insert a line at the end of a file. The key is setting an insertion
point and then set the selection.
...
my ToBBEdit(aList, Short_Title)
...
--
-- Write out names in outline format
-- Indent is the number space to ident the line
--
on ToBBEdit(NextName, Title)
local blanks, nextLine
tell application "BBEdit"
tell front window
set blanks to characters 1 thru indent of " "
set nextLine to blanks & NextName & " " & Title & return as Unicode text
select insertion point after last character
set selection to nextLine
end tell
end tell
return
end ToBBEdit
--
Good friends are hard to find, harder to leave, and impossible to forget.
Bill Verity - 814-865-4758 Fax: 814-863-7049
215A Computer Building - Information Technology Services, Penn State University
At the office - on my Mac, of course ;-)
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <***@barebones.com>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to: <bbedit-talk-***@barebones.com>
Loading...