Counting Copied Items in the Clipboard

example...
I have a text file as below.

A
B
C
D

I want to make a macro which copy first line (here A), then find the file with name A containing in it, then copy all those files to clipboard (like if 2 files names containing A) Then it should show me end result like below....

A = 2
B = 5
C = 3
D = 0 ( 5 files with B letter in it, 3 files with C letter in it, 0 file containing D letter in it)

I think you would probably need to show us where you have got to, if you need any advice about the next step.

Showing us your draft might also clarify some of the descriptions above.

Hey Hiren,

If I understand correctly:

  • You want to find the files in a directory whose NAME contains each letter/word in a list.

  • You want to copy the contents of each of those files to the clipboard.

  • You want a summation showing how many of each letter/word was found.

Correct?

If so then the big remaining question is where are the files to be found?

In a single flat directory (folder)?

In a directory with subdirectories?

Please clarify.

-Chris

As you can see, we need more info about your requirements.
Please read:
Tip: How Do I Get The Best Answer in the Shortest Time?

Yes correct. files to be found anywhere in the pc, just need to count how many of each of the letter / names?

Anywhere on your Mac?

Any connected hard drive?

-Chris

Not connected any external drive.

So you want to search your whole hard drive?

yes correct

That's a tough nut.

You'll have to learn to use Spotlight from the command line.

If you want further help you'll need to provide real world examples of what you want to do.

Without those any testing is a waste of time.

If you didn't already pease take the time to read this:

Tip: How Do I Get The Best Answer in the Shortest Time?

None of us has the time for long question and answer sessions just to find out the requirements of a task.

Remember – you know your task from the inside out – but unless you can explain it thoroughly and succinctly to others it's really hard to get good help.

-Chris

Can you just simply tell me if there is any option which gives values that how many items had been copied in the clipboard?

No.

Not the way you've phrased your question.

-Chris

I'm not sure if this is what you are asking, but if you want want to know how many items, i.e. lines, are on the clipboard, you can use this simple KM Filter action:

image

If you want to know the number of individual clipboards (one for each separate copy) made sequentially from a given starting point, take a look at the Paste macro here:

Paste In Order Copied