How would I go about tagging all the files in a folder that were in a certain file range?

For instance, how would I tag all the files in a folder that were between 2 and 10 megabytes in size?

Thanks!

-jg

Here's a quick (untested) example:

Tag All Files in Folder Between 2–10MB.kmmacros (3.6 KB)
image

1 Like

I think the first action should be "Get File Size", not "Get File Type", right?

Good catch. Fixed.

Thanks for your efforts, but when I tried this, it didn't seem to do anything at all. I set it up, I think correctly, and tried it. Nothing happened. Even when I turned on the Debugger, I couldn't get any indication that anything was happening.

1st, looking through it, I wonder if the
Get File Size to Variable "LocalFileSize"
from file %Variable%LocalFile%

should say from file %Variable%LocalFileSize%
I tried it both ways and nothing at all happened that I could see.

How would you make the tag a Color Label? I stuck with TAG NAME, but absolutely nothing happened. Evidently the process never got the far. In fact it doesn't seem to have even gotten off the ground, so to speak.

Thanks again!

No problem. The macro works fine for me (and yes, it's supposed to be from %Variable%LocalFile% to Variable LocalFileSize so I'm guessing one or both of the following reasons may explain why it didn't work for you:

  1. Did you set the path to the folder you want to use this with in the first step, making sure the path was valid?
  2. Did you make sure there was at least one file between 2-10 MB in size in that folder?

You can make the tag a color label just by using the same tag name as the color you want.

28 PM

Well, if that isn't the durndest thing. Maybe the computer and I just needed a little sleep. I just went through everything step by step. It all seemed to be exactly as you stepped it out. I did change the location of the Macro from your Testbed folder into my Finder Macro folder. And changed the tag name to Red. Then I ran it and it worked exactly like it was supposed to. Go figure!

Anyway, Thanks! Again!!

1 Like