INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: listitem () help  (Read 850 times)

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
listitem () help
« on: May 16, 2014, 04:02:50 pm »

i'm on an MC tear, so pardon all the questions lately

i have a lot of files where i've used [keywords] to alter the viewing.  it of course works great

but now, i want to move files around physically...i have hundreds of thousands of work documents/photos that i have used keywords to dictate the viewing (i.e. by project, client, etc.)

i would really like to use the keywords to choose where they go....the problem is, some have say 10 keywords while others have 1 keyword, so using listitem doesn't seem to work, as if i choose listitem([keywords],1) it always returns null (the files go to the specified parent folder). 

i should specify, that when using a listitem expression for a pane view it always works fine, just not in the move files dialog.  i've been reading about 0 as empty and all that, but there are no files without any keywords therefore no blanks

is there an expression way around this?

thanks

edit:  there's clearly something going on that's different about the R,M&C file dialog than from the regular expression pane.  i can make this work six ways from sunday in panes, but it never, ever works in the dialog. 
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: listitem () help
« Reply #1 on: May 16, 2014, 07:55:22 pm »

The Rename tool uses the Display representation of a field (not the Raw version).  This happens so that fields such as [Artist] which might be used as a path component like:

   ...\[Artist]\[Album]\...

do not disappear when the artist value is empty, because you'd end up with:

   ...\\[Album]\...

and this is path you probably don't want.  Read about Field Values.

Since [Keywords] is a list type field, the Rename tool deals with it in its Display form.  And in its display form, there is only a single string - all your keywords joined by "; ".  So, you want to use the raw form [keywords,0] in your ListItem() when the expression is being evaluated by the Rename tool.  This is explained in Field Values: Empty, 0, and 1.
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up