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

Re: Testing for a specific value in a folder name


  • Subject: Re: Testing for a specific value in a folder name
  • From: Brett Conlon <email@hidden>
  • Date: Wed, 5 Jul 2006 18:54:49 +1100


Many thanks to all who kindly responded.

I'll be keeping all suggestions on file for future reference.

What I ended up running with is the following:

on run
        tell application "Finder"
                set PickFolder to choose folder
        end tell
        CheckDNum(PickFolder)
end run

on open folderList
        repeat with PickFolder in folderList
                CheckDNum(PickFolder)
        end repeat
end open

on CheckDNum(PickFolder)
        tell application "Finder"
                set aFolder to name of PickFolder
                set OutputFldr to first folder of PickFolder whose name contains "Output"
                set OutputFiles to (name of every file of entire contents of OutputFldr) as string
                --Get DNos from Files and compare it with Archive Folder.
                set Dnum to {}
                repeat with chunk in (every word of OutputFiles)
                        considering case -- we are looking for capitals
                                if item 1 of chunk is "D" then
                                        if length of chunk is in {5, 6} then -- is it the right length?
                                                try
                                                        (text 2 thru -1 of chunk) * 1 -- is the remainder a number?
                                                        set end of Dnum to chunk as Unicode text
                                                end try
                                        end if
                                end if
                        end considering
                end repeat
                repeat with checkDno in (every item of Dnum)
                        if not (aFolder contains checkDno) then
                                display dialog "Missing D Num [" & checkDno & "] from Archiving folder"
                        end if
                end repeat
        end tell
end CheckDNum

I'll work it a little more and add other checks but this is a great start!

Cheers,

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

References: 
 >Re: Testing for a specific value in a folder name (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Testing for a specific value in a folder name
  • Next by Date: Re: Tiger sometimes fully expand a window: how do I resize it to be smaller ?
  • Previous by thread: Re: Testing for a specific value in a folder name
  • Next by thread: Popup menu in interface builder
  • Index(es):
    • Date
    • Thread