Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Tag folder contents

Is there a quick way to tag all the contents of a folder including sub-folders and their contents?

iMac, Mac OS X (10.7.2)

Posted on Dec 10, 2013 9:30 AM

Reply
25 replies

Aug 21, 2014 6:44 PM in response to anafurn

Hi,


Thank you for taking the time to step us through how to create an automator file. I found it extremely helpful and informative and now Im intrigued to think of how else I might use the Automator application. So thank you.


My problem with the automator app as described is that it only gives you the option of colour tagging the folder/contents selected (dropped onto the app). I'm not sure about other people but I don't the tagging function like that. I actually use it to categorise and make sense of my data. So I have about 15 tags at present that broadly group into either interest categories or application categories. This enables me to quickly and easily arrange the presentation of top level folders so that the contents are presented into a meaningful and easily discernible format. Having 40 applications listed in alphabetical name order can be helpful; but so too can grouping them into my own category groups. The same as for documents and other files.


Is it possible for automator as part of creating this app, to actually display the tags in full that you use in maverick? It just seems to odd to only allow you to select a colour code which has no association to any existing tag labels (i.e. if I select the red tag it labels the folder RED). Perhaps others have well defined colour associations that are meaningful. But for me personally I really do need the text to prompt me and wouldn't want the added process of referring to a legend to decipher the colour index. And of course, my issue is that I'm in fact using more tags then colour options provided by apple. Meaning that colours are repeated a couple of times so they do not have a direct linear or one-on-one association.


I just thought Apple would have presumed users might implement their tagging feature in a slightly more sophisticated manner then a simply 5 point colour matrix. Which reminds of some pre-school project (laugh). Or perhaps my attempt at humour is just an attempt to distract from myself from the fact that perhaps others have much better memories then myself. Although, I do have adult ADHD so I can at least attest to the fact that my memory functioning has never been very good and I cannot understate how much the development of recent advances in assistive technology have made the biggest improvement to my life. Seriously, just simple concepts like Apple's environment where information is readily accessible and updated on any device I use. Because if one cannot readily rely on your brain for memory recall (not in any reliable or consistent manner anyhow), then it becomes vital and incredibly valuable to have what in effect amounts to a 'pseudo-memory bank' by way of information captured, stored and then most importantly filtered through incredibility clever applications - making it possible for people like myself with memory functioning dysfunction, to operate in the world to greater extent without the effects of this impairment.


And its only through advances in technology that this has become possible. But it is also why filtering in its many varied forms, is so important to me. As I need tools to limit and focus on whats relevant, otherwise it becomes a mountain of disorganised mush and basically meaningless. Who can possibly sort though a computers 100,000+ files for instance. Its only through filters like folders, types, categories and now tags; that we can easily home in on the data relevant to our current activity.


Anyhow, enough of my divergence from the question at hand.


If what I've asked about is in fact possible, then i would be grateful for any advice on how I might implement that. (excluding the shift/select alternative described by the other contributor). As I'm intrigued to know if this is in fact possible using Automator.


Kind regards,


Blair.

Aug 22, 2014 4:13 AM in response to Bazzalad

Can't help I'm afraid except to point out that you can assign labels to the colours but as far as I can see only up to eight. For example I have Business, Community, Computer, Finance, Home, Important, Media and Travel & Holidays.


I tried to amend the FolderLabel app to add another level to include sub-sub folders but it didn't work.


Good luck.

Aug 26, 2014 5:26 PM in response to Luke Eischen

Luke Eischen wrote:


Actually it didn't work. I left the "Label Finder Items" and it doesn't label the sub-folders. I also tried by leaving that and the "Get Folder Contents" but then it labeled all the files as well. I am just trying to label the folders and sub-folders.


Thanks.


Hi,

Here's how to get only the subfolders:

1- Add the "Run AppleScript script" action at the first position of the workflow

Cut all text in the action

Copy/paste this script in the action.

property maxdepth : 1 -- to limit the depth (0 = no limit, 1 = one level)
property includeInputFolder : true --  false = The input folders will be excluded from the output list, set it to true to include the input folder

script o
    property folderList : {}
end script

on run {input, parameters}
    repeat with i in input
        if folder of (info for i without size) then
            if includeInputFolder then set end of o's folderList to contents of i
            my getSubfolder(i, 1)
        end if
    end repeat
    return o's folderList -- the output list
end run

on getSubfolder(f, currLevel) --  recursively descends the directory tree
    tell application "System Events" to set L to (path of folders of f)
    set tc to count L
    repeat with j from 1 to tc
        set subF to (item j of L) as alias
        set end of o's folderList to subF
        if maxdepth = 0 or maxdepth > currLevel then my getSubfolder(subF, currLevel + 1)
    end repeat
end getSubfolder


2- Keep the "Label Finder items" action to the second position.



Save

Aug 28, 2014 10:53 AM in response to anafurn

anafurn wrote:


Jacques,


Does your script tag files in sub-folders as well as the sub and sub-sub folders themselves?


Thanks.


No, my script return the master folder and the folders in the master folder only, if you want more subFolders, set the maxdepth to 0 in the first line of the script.


If you want to tag files, sub-folders and files in subfolder, you don't need an AppleScript script, use this workflow , Drag/Drop the master folder on the application

Tag folder contents

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.