• 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: NSRegular expression question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRegular expression question


  • Subject: Re: NSRegular expression question
  • From: Shane Stanley <email@hidden>
  • Date: Sun, 3 Sep 2017 11:50:40 +1000

On 3 Sep 2017, at 1:12 am, Jim Weisbin <email@hidden> wrote:
>
> To get rid of the leading zeroes in order to do the look up, I’m casting the
> string to an integer, which works. It’s guaranteed to be a number based on
> the regex above, but is there any down side to doing it that way?

Sounds fine to me:

        set theWord to (theText's substringWithRange:matchRange)'s
integerValue() as text

Also, these two lines:

set thePathNoExt to pathString's stringByDeletingPathExtension()
set theText to current application's NSString's stringWithString:thePathNoExt

can be one:

set theText to pathString's stringByDeletingPathExtension()

--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: NSRegular expression question (From: Jim Weisbin <email@hidden>)
 >Re: NSRegular expression question (From: Jim Weisbin <email@hidden>)
 >Re: NSRegular expression question (From: Jim Weisbin <email@hidden>)

  • Prev by Date: Re: NSRegular expression question
  • Next by Date: Re: NSRegular expression question
  • Previous by thread: Re: NSRegular expression question
  • Next by thread: Re: NSRegular expression question
  • Index(es):
    • Date
    • Thread