• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Working with text selections in Xpress
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Working with text selections in Xpress


  • Subject: Re: Working with text selections in Xpress
  • From: Michael Turner <email@hidden>
  • Date: Tue, 13 Nov 2001 10:02:23 -0400

> Is there a way of ensuring that you are referring to a chunk of text that is
> highlighted rather than a text box? So that you don't end up processing a
> large
> amount of text should you inadvertently start the script when you have a
> text
> box selected (that would also be a selection would it?)
> Fred


Fred,

Yes, users will hit the script while they have the wrong tool selected.

You can use

set tool mode to contents mode

and

set tool mode to drag mode

To ensure that you have the text selection tool enabled (first one).
Or the drag tool (second line). Note that these commands take
measurable TIME.

While in content mode, you can check that there is a selection
like this:

set currentSelection to current box

if currentSelection = null then
display dialog "No selection, try again."
return
end if

I suppose you could test the range of the selection directly.

When a box is selected in content mode, but there is not a text selection,
then there is an insertion point. You might test for that if you find
this test insufficient.

/Michael


References: 
 >RE: Working with text selections in Xpress (From: email@hidden)

  • Prev by Date: Re: 9.1 and Installed Fonts
  • Next by Date: Re: installers
  • Previous by thread: RE: Working with text selections in Xpress
  • Next by thread: Scripting Palm Desktop (was Re: Saving an attachment from)
  • Index(es):
    • Date
    • Thread