Spotlight Comments with Folder Containing Names

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

I have tried to update spotlight comments with the Folder Containing Names field. The resulting spotlight comment is null where that field should be. Is there something else I need to do?
learned
 
Posts: 29
Joined: Sun Jun 21, 2009 5:18 pm

Can you post your rule? Can't say without more details.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Can you post your rule? Can't say without more details.


The rule is executing. I can see that.

If ALL of the following are met for file or folder being matched:
- Kind is Image

Rename with pattern date created - source folder extension
Add comment with pattern date created, containing folder names, SL
Set color label Purple

What I get is everything executing except the comment comes up:

2013-01-04, , SL

So everything works but containing folder names comes up blank. The color changes and the file renames just fine.
learned
 
Posts: 29
Joined: Sun Jun 21, 2009 5:18 pm

What is "containing folder names"? Is that a token/attribute or is that literally the text "containing folder names" ?
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Containing Folder Names is one of the options of what can be inserted into the comment, selected from the "Other" option. (See image)

Image
learned
 
Posts: 29
Joined: Sun Jun 21, 2009 5:18 pm

I don't have that on my system. I'm guessing some app you have installed is providing that and I'm guessing it probably only gets filled out for files from that app.

If you want to put the name of the enclosing folder, you can maybe try something a bit odd as follows:
Code: Select all
If (all) are met for (file being matched)
Kind is Image
If (all) are met for (enclosing folder)
   Name matches (•name)
Then
   Rename (date created)(•name)SL
   ...

where (•name) is a custom token defined to be (anything). Search the help for match patterns to help understand the above but I think that should work.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks, actually what I am trying to do however is to update the spotlight comment with the name of every folder in the target file's path. I have the following set up to retrieve the path:

tell application "System Events"
set thePath to POSIX path of theFile
end tell
return thePath


But it does not seem to be working yet.
learned
 
Posts: 29
Joined: Sun Jun 21, 2009 5:18 pm

That only returns the full path of the file. Search around for example scripts on how to manipulate that to get the right name.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I was trying to use Containing Folder Names as well. Turns out, this is an OmniFocus Spotlight attribute! I haven't found a use for it, but now that I'm not trying to use it for locating Finder files, my life is much more sane.
jxpx777
 
Posts: 2
Joined: Tue Jul 28, 2009 12:32 pm


Return to Support