• 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: Simple text question - solved
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Simple text question - solved


  • Subject: RE: Simple text question - solved
  • From: "Script2" <email@hidden>
  • Date: Wed, 9 Jul 2008 10:51:36 -0400
  • Importance: Normal

Thanks Mark,

I tried but was not getting 100% results. This being a new project I decided
the number before [F] can only be between 1000 - 9999. Along with Michelle's
example the problem will be solved.

set a to "gibberish6000[F]this is test (#1).

6001[F]this is test (#2)."

set offst to offset of "[" in a
if offst is greater than 5 then
	set a to text offst through end of a
end if


I just changed the "set a to text offst through end of a" to "set a to text
offst-4 through end of a" ---works.

Thanks everyone for your input and time.

Ruby

-----Original Message-----
From: applescript-users-bounces+script2=email@hidden
[mailto:applescript-users-bounces+script2=email@hidden]
On Behalf Of Mark J. Reed
Sent: Monday, July 07, 2008 5:12 PM
To: Applescript Users
Subject: Re: Simple text question

On Mon, Jul 7, 2008 at 5:06 PM, Michelle Steiner <email@hidden>
wrote:
>> set a to "gibberish 123430[Foobazoo]this is test (#1)."
>
> But is the number 3430, 430, 30, or 0?

Well, they can't all be allowed; right now the algorithm is greedy and
takes as many digits as it can.

In order for this to be a tractable problem, the pattern needs to be
either of the following:

               anything ending in a non-digit, followed by any number
of digits, followed by bracketed text

or
               anything, including digits, followed by at most four
digits, followed by bracketed text

In the second case one further needs to specify how to determine where
numeric gibberish stops and the desired number starts.


>
> And is the gibberish the corresponding "gibberish 12", "gibberish 123",
> "gibberish 1234", or "gibberish 12343"?
>
> -- Michelle
>
> --
> "As a matter of general principle, I believe there can be no doubt that
> criticism in time of war is essential to the maintenance of any kind of
> democratic government ... too many people desire to suppress criticism
> simply because they think that it will give some comfort to the enemy to
> know that there is such criticism."  -- Robert A. Taft, December 19, 1941
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
m
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
>



--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
tern.com
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


 _______________________________________________
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

References: 
 >Re: Simple text question (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Scripting NOAA Weather data for an iPod
  • Next by Date: Re: Scripting NOAA Weather data for an iPod
  • Previous by thread: Re: Simple text question
  • Next by thread: Re: Simple text question
  • Index(es):
    • Date
    • Thread