INTERACT FORUM

Please login or register.

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

Author Topic: Renaming Files Using Expressions  (Read 827 times)

darichman

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1362
Renaming Files Using Expressions
« on: June 02, 2006, 03:13:22 am »

Hey guys...

I'm trying to come up with an expression to organise my photos on the physical drive, but I've run across some problems...

I use some custom fields:
[Photo (Source)] = Who/Where I got an album of photos from. Is only populated if there is an album with files from more than one source.
[Set] = The physical real life photo album I scanned photos from (eg 0001, 0002 etc).
[Album] & [Date (Year)] are default fields.

So basically, the general file paths I want are:
If either album or year are empty, files go in: "Photos\#To Sort\"
If both album & year are filled: "photos\year\album\"
And if the Photo Source field is filled out, I want: "photos\year\album\source"

The conditions I tried using for the expression were:
•   IF [Photo (Source)] EMPTY
            o        IF [Date (Year)] EMPTY
                       •   IF [Album] EMPTY
                                    •   Photos\#To Sort\[Set]
                       •   IF [Album] NOT EMPTY
                                    •   Photos\#To Sort\[Album]
              o        IF [Date (Year)] NOT EMPTY
                       •   IF [Album] EMPTY
                                    •   Photos\#To Sort\[Date (Year)]
                       •   If [Album] NOT EMPTY
                                    •   Photos\[Date (Year)]\[Album]

•   IF [Photo (Source)] NOT EMPTY
              o        IF [Date (Year)] EMPTY
                       •   IF [Album] EMPTY
                                    •   Photos\#To Sort\[Set]
                       •   IF [Album] NOT EMPTY
                                    •   Photos\#To Sort\[Album]\[Photo (Source)]
              o        IF [Date (Year)] NOT EMPTY
                       •   IF [Album] EMPTY
                                    •   Photos\#To Sort\[Date (Year)]
                       •   If [Album] NOT EMPTY
                                    •   Photos\[Date (Year)]\[Album]\[Photo (Source)]


I've tried a number of expressions, but MC keeps making folders with "Unknown [InsertFieldHere]" even when the expression dictates it shouldn't... As far as I can tell, the expression below covers every combination of possible field entries, but I still get files in "Unknown Album" or "Unknown Date (Year)" folders (when they should go into my "#To Sort" folder...). Similarly, files for which [Photo (Source)] is empty still end up in "Photos\Year\Album\Unknown Photo (Source)" folder when they should just be in "Photos\Year\Album"

Anyway, here's what I came up with:
If(IsEmpty([Photo (Source)]), If(IsEmpty([Date (Year)]), If(IsEmpty([Album]), Photos\#To Sort\[Set], Photos\#To Sort\[Album]), If(IsEmpty([Album]), Photos\#To Sort\[Date (Year)], Photos\[Date (Year)]\[Album])), If(IsEmpty([Date (Year)]), If(IsEmpty([Album]), Photos\#To Sort\[Set], Photos\#To Sort\[Album]\[Photo (Source)]), If(IsEmpty([Album]), Photos\#To Sort\[Date (Year)], Photos\[Date (Year)]\[Album]\[Photo (Source)])))

I know some of you out there are using some pretty advanced expressions ~ any advice on what I'm doing wrong here?

Interestingly, I used the same expression as a calculated field, and the output displayed what I want perfectly.... Does the rename file from properties function handle expressions differently or something?
Logged
Pages: [1]   Go Up