• 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
getting reference as string for rebuilding a reference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getting reference as string for rebuilding a reference


  • Subject: getting reference as string for rebuilding a reference
  • From: Adam Morris <email@hidden>
  • Date: Tue, 25 Jan 2011 11:01:31 +0700

Hi there applescripters,

I'm scripting Pages, and the "get selection" gives me a reference like this:

text from character 44 to character 49 of body text of document id
1706710 of application "Pages"

What I want to do is calculate a new selection (say, from character
start_char to character end_char) based on that first, given,
selection.

With other languages I just convert the reference to a string and use
a regexp to extract the numbers, and then rebuild it. Yet in
Applescript, when I use "as text" for that reference, though, it
returns the actual text from the Pages application (as one would
expect).

The problem is, how can I get Applescript to store a part of a
reference into a variable?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: getting reference as string for rebuilding a reference
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: getting focus, slow getting icon position in window
  • Next by Date: Re: getting reference as string for rebuilding a reference
  • Previous by thread: Re: Is it possible to set the main edit window of Adobe Photoshop Elements
  • Next by thread: Re: getting reference as string for rebuilding a reference
  • Index(es):
    • Date
    • Thread