Page 1 of 1

Spotlight Comments with Folder Containing Names

PostPosted: Thu Jan 03, 2013 4:16 pm
by learned
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?

Re: Spotlight Comments with Folder Containing Names

PostPosted: Fri Jan 04, 2013 3:33 pm
by Mr_Noodle
Can you post your rule? Can't say without more details.

Re: Spotlight Comments with Folder Containing Names

PostPosted: Fri Jan 04, 2013 6:56 pm
by learned
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.

Re: Spotlight Comments with Folder Containing Names

PostPosted: Mon Jan 07, 2013 3:45 pm
by Mr_Noodle
What is "containing folder names"? Is that a token/attribute or is that literally the text "containing folder names" ?

Re: Spotlight Comments with Folder Containing Names

PostPosted: Mon Jan 07, 2013 4:53 pm
by learned
Containing Folder Names is one of the options of what can be inserted into the comment, selected from the "Other" option. (See image)

Image

Re: Spotlight Comments with Folder Containing Names

PostPosted: Tue Jan 08, 2013 4:48 pm
by Mr_Noodle
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.

Re: Spotlight Comments with Folder Containing Names

PostPosted: Sun Jan 20, 2013 8:09 pm
by learned
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.

Re: Spotlight Comments with Folder Containing Names

PostPosted: Tue Jan 22, 2013 1:36 pm
by Mr_Noodle
That only returns the full path of the file. Search around for example scripts on how to manipulate that to get the right name.

Re: Spotlight Comments with Folder Containing Names

PostPosted: Fri Mar 08, 2013 2:43 pm
by jxpx777
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.