Author Topic: Automatically Create Directories Using Variables?  (Read 4928 times)

Offline GoremanX

  • Newcomer
  • *
  • Posts: 3
    • View Profile
Automatically Create Directories Using Variables?
« on: February 24, 2013, 03:40:17 PM »
Is it possible to have Photo Mechanic automatically create directories based on the same variables available in file naming?

I tried to use the \ character in the filename, but that doesn't work. It gets converted to - instead.

(running PM 5 build 13764 on Windows 7)
« Last Edit: February 24, 2013, 03:41:57 PM by GoremanX »

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Automatically Create Directories Using Variables?
« Reply #1 on: February 24, 2013, 04:24:33 PM »
Is it possible to have Photo Mechanic automatically create directories based on the same variables available in file naming?

I tried to use the \ character in the filename, but that doesn't work. It gets converted to - instead.

(running PM 5 build 13764 on Windows 7)

The character '\' is the path separator character on Windows.  It can't be used in a filename.  Why do you want to use it in a filename?

Please show me an example of what you're trying to accomplish.

-Kirk

Offline GoremanX

  • Newcomer
  • *
  • Posts: 3
    • View Profile
Re: Automatically Create Directories Using Variables?
« Reply #2 on: February 24, 2013, 04:38:38 PM »
Yeah I know, that's kinda the point. My entire post was a single question, not 2 unrelated questions.

For example, I want to transfer files from my memory card to:

P:\Shoots\NY\Rouses Point\{date}\{artist}-{make}{model}\IMGPxxx.DNG

But I can't find a way to automatically create directories using variables. So I tried to do it via file renaming and using the \ character to imply a directory path in the filename, but the \ character isn't allowed, so that doesn't work either.

It's tedious to manually create all those directories, so I was hoping that Photo Mechanic would be able to do it on the fly.

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Automatically Create Directories Using Variables?
« Reply #3 on: February 24, 2013, 04:54:17 PM »
Yeah I know, that's kinda the point. My entire post was a single question, not 2 unrelated questions.

For example, I want to transfer files from my memory card to:

P:\Shoots\NY\Rouses Point\{date}\{artist}-{make}{model}\IMGPxxx.DNG

But I can't find a way to automatically create directories using variables. So I tried to do it via file renaming and using the \ character to imply a directory path in the filename, but the \ character isn't allowed, so that doesn't work either.

It's tedious to manually create all those directories, so I was hoping that Photo Mechanic would be able to do it on the fly.

Photo Mechanic can do all of that.  Use those variables in the 'Folder Name:' field instead.  That's where you build a path, not in the filename renaming.  The Folder Name field won't stop you from using backslash characters.

HTH,

-Kirk

Offline GoremanX

  • Newcomer
  • *
  • Posts: 3
    • View Profile
Re: Automatically Create Directories Using Variables?
« Reply #4 on: February 24, 2013, 05:03:54 PM »
Ah, I didn't see the option "into folder with name" under "Copy Photos".

That works now, thanks!

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Automatically Create Directories Using Variables?
« Reply #5 on: February 24, 2013, 11:41:27 PM »
You can also use a different character to mark code replacements. I use the ` (back tick) character and that works nicely.
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24730
    • View Profile
    • Camera Bits, Inc.
Re: Automatically Create Directories Using Variables?
« Reply #6 on: February 25, 2013, 06:33:21 AM »
Hayo,

You can also use a different character to mark code replacements. I use the ` (back tick) character and that works nicely.

Very true, but the OP wasn't using Code Replacement, and only wanted to use variables.  I also originally thought they wanted to use Code Replacements in their folder creation but figured it out after their second post.

-Kirk