On 4/21/19 at 11:11 AM, [email protected] (F. Alfredo
Rego) wrote:
I have explored everywhere I can, but I can’t find any way to
DESELECT/UNSELECT selected text.
There is no concept of "unselecting", because there is always a
selection, even if it's empty (an insertion point).
I’m particularly interested in including a “deselect all” in a script
like this, which leaves the entire contents of the “Prototype” file
selected and highlighted after I have copied the “Prototype” file to
the “Release” file.
You can avoid the whole issue by not using the clipboard. :-)
(In general, you shouldn't use the clipboard to pass data around
within a script.)
There are a couple of things that will help you write faster and
more reliable scripts:
- the "open" verb always returns a reference to the document
that was opened;
- the contents of any text document are available as text. This
is the "text" property.
So, your first tell block will look something like this:
set openedDocument to (open file "...")
set documentText to text of openedDocument
Then you can manipulate "documentText", and finally:
set documentToRewrite to (open file "...")
set text of documentToRewrite to documentText
R.
--
Rich Siegel Bare Bones Software, Inc.
<[email protected]> <http://www.barebones.com/>
Someday I'll look back on all this and laugh... until they
sedate me.
--
This is the BBEdit Talk public discussion group. If you have a
feature request or need technical support, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <https://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].
Visit this group at https://groups.google.com/group/bbedit.