On 5/21/14 at 10:43 AM, [email protected] (David Weinberger) wrote:
I'm writing something with frequent endnotes and would like to
automate how I insert them. I currently have a Keyboard Maestro
macro that lets me insert [^][^]: with a keystroke. But, in a
perfect world, I'd have a script in BBedit that lets me
automate that further, possibly as follows:
1. A keystroke pops up a dialogue box that has a field for the
keyword to insert into the endnote markup and a field for the
[endnote content]
2. With a button press, that dialogue box 1. creates the anchor
note (e.g., [^example]) and the note itself (e.g.,
[^example]This is an example of an endnote),
2. inserts the anchor note at the current cursor position, and
3. inserts the note itself at the end of the document 4. (and
also adds two carriage returns, as we used to call them)
Possible? Plausible? Is there a better way?
The one drawback to AppleScript for this purpose is that you
can't get both inputs at once (though you can do everything else
with it); thus, you may want to try using a helper like Pashua:
<http://www.bluem.net/en/mac/pashua/>
to bridge that gap, and then your script can handle the rest of
the work.
Also, as a reminder, you can add a key shortcut to any script
installed into BBEdit's Scripts folder via the Menus & Shortcuts
preference pane (or in the Scripts palette).
Regards,
Patrick Woolsey
==
Bare Bones Software, Inc. <http://www.barebones.com/>
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/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 [email protected].
To post to this group, send email to [email protected].