• 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
Labelling identically-named files in two Finder folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Labelling identically-named files in two Finder folders


  • Subject: Labelling identically-named files in two Finder folders
  • From: peter boardman <email@hidden>
  • Date: Mon, 31 Jan 2005 13:06:50 +0000

I want to compare two folders and label any files that appeared in both (names the same, not bothered about comparing anything else).

My first attempt looks like this:

--
tell application "Finder"
    set l to every window whose collapsed is false
    set p to every item of first item of l
    set q to every item of second item of l
    set pCount to count p
    set qCount to count q
    if pCount ≥ qCount then
        my compareLists(p, q)
    else
        my compareLists(q, p)
    end if
end tell

to compareLists(x, y)
    -- longest list first
    tell application "Finder"
        repeat with i from 1 to count x
            set a to name of item i of x
            repeat with j from 1 to count y
                set b to name of item j of y
                if a is b then
                    set label index of item j of y to 5
                    set label index of item i of x to 5
                    exit repeat
                end if
            end repeat
        end repeat
    end tell
end compareLists
--

But it’s terribly slow. For 500 files in each folder, it takes well over half an hour. How can I speed it up?

Pete
 _______________________________________________
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

  • Prev by Date: Re: Basic question - Getting Mac path to file
  • Next by Date: Re: Basic question - Getting Mac path to file
  • Previous by thread: Re: Basic question - Getting Mac path to file
  • Next by thread: Re: Labelling identically-named files in two Finder folders
  • Index(es):
    • Date
    • Thread