• 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
Search for a character
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Search for a character


  • Subject: Search for a character
  • From: "Timothy K. Wilkinson" <email@hidden>
  • Date: Mon, 19 Sep 2005 11:00:52 -0400

I'm having a syntax problem with parsing a text string.

I've parsed a line of text into individual words in a variable.  The word I
want is the only one that contains a "%".  However I can't seem to find the
right syntax to parse it out.

Basically I just need a line that says "give me every word in this line that
contains a %".

I'm running 10.4.2 on all of the machines this script would run on.

The part of the script that is affected is this:

do shell script "df -h /"
set theSize to the result as text
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to return
try
    set theLine to text item 2 of theSize
    set AppleScript's text item delimiters to space
--Here's where I need to parse out the "%" sign
    set theCap to every text item of theLine that contains "%" as text


Anyone know the syntax I would need?

Thanks!

Tim Wilkinson
ITC-ACHS
University of Virginia
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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Search for a character
      • From: pete boardman <email@hidden>
  • Prev by Date: Re: Properties within Properties - Scripting Address book
  • Next by Date: Re: Check to see if a computer is running....
  • Previous by thread: Re: How to do some AppleScript inside a Perl program to label duplicates
  • Next by thread: Re: Search for a character
  • Index(es):
    • Date
    • Thread