• 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: pulling substrings, test first
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pulling substrings, test first


  • Subject: Re: pulling substrings, test first
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 7 Dec 2007 10:54:15 -0700

On Dec 7, 2007, at 9:02 AM, Justin Laden wrote:

How can I get AppleScript to help me remove the "job number" out of
the following string:

Q1892_04_NGSS Exterior AM Gel.indd

I just want the "Q1892" segment.


If by "segment" you mean the string beginning with that and ending with "NGSS", and the format is always the same, then

first word of "Q1892_04_NGSS Exterior AM Gel.indd"

If you mean just those five characters, and that segment is always five characters, then this will work

text 1 through 5 of "Q1892_04_NGSS Exterior AM Gel.indd"

If you mean everything before the first underscore with a varying number of chararacters, this will work:

set AppleScript's text item delimiters to "_"
text item 1 of "Q1892_04_NGSS Exterior AM Gel.indd"

-- Michelle

--
"Experience in that marvelous thing that enables you to recognize a mistake when you make it again." --F. P. JONES



_______________________________________________ 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: 
 >pulling substrings, test first (From: "Justin Laden" <email@hidden>)

  • Prev by Date: Re: Changing the name of a file in the temporary items folder
  • Next by Date: Re: Finder inconsistency (Was: What makes AppleScript difficult)
  • Previous by thread: pulling substrings, test first
  • Next by thread: Another Quicktime question
  • Index(es):
    • Date
    • Thread