Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Testing for a specific value in a folder name




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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.