• 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
Testing for a specific value in a folder name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Testing for a specific value in a folder name


  • Subject: Testing for a specific value in a folder name
  • From: Brett Conlon <email@hidden>
  • Date: Wed, 5 Jul 2006 12:13:09 +1100


Hiya,

I have a word list  (taked from a folder name) and I want to test for a spoecific word in it. The folder name goes like this:

21 Move Title D12345 33 41 BC

I want to test if the D number is present. So far I've coerced the name to a word list but I can't get the syntax to find a word beginning with D and has numbers after it. The D number is not alwats 5 characters either - older jobs had 4 characters.

Later I want to use this to check that the construction file (Quark/Freehand etc) they have in that job folder has the same D Number.

Here's what I have so far but the last line errors....

on run
        set aFolder to choose folder
        CheckDNum(aFolder)
end run

on CheckDNum(aFolder)
        tell application "Finder"
                set item_name to the name of aFolder as text
                set AppleScript's text item delimiters to " "
                set AllWords to every word of item_name as list
                log AllWords
                set Dnum to every word of AllWords whose character 1 is "D"
        end tell
end CheckDNum

Many thanks,

Coj
 _______________________________________________
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: Testing for a specific value in a folder name
      • From: Axel Luttgens <email@hidden>
    • Re: Testing for a specific value in a folder name
      • From: Michelle Steiner <email@hidden>
    • Re: Testing for a specific value in a folder name
      • From: Adam Bell <email@hidden>
    • Re: Testing for a specific value in a folder name
      • From: Malcolm Fitzgerald <email@hidden>
  • Prev by Date: Re: Saving parts and settings
  • Next by Date: Popup menu in interface builder
  • Previous by thread: Re: Troubles with the date class (doc)
  • Next by thread: Re: Testing for a specific value in a folder name
  • Index(es):
    • Date
    • Thread