Thanks Rich.

I’ll immediately correct/improve my first (second?) AppleScript ever ;-)

As a favorite professor used to say: You have to know everything before you can 
do anything.

I appreciate the guidance.

Alfredo

> On Apr 22, 2019, at 7:23 AM, Rich Siegel <sie...@barebones.com> wrote:
> 
> On 4/21/19 at 11:11 AM, f.alfredor...@gmail.com (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.
> <sie...@barebones.com>                      <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
> "supp...@barebones.com" 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 bbedit+unsubscr...@googlegroups.com.
> To post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" 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 bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to