Author Topic: Random Number Instead of Sequence Number  (Read 392 times)

Offline Rob Hedge

  • Newcomer
  • *
  • Posts: 17
    • View Profile
Random Number Instead of Sequence Number
« on: October 23, 2020, 01:31:14 PM »
I want to use a random number {rand100} instead of a sequence number {seqn} for a batch of photos. However, the "File > Rename Photos..." dialogue box won't let me use a random variable without also using the sequence variable. There are fewer than 100 photos in the batch. See screen capture below.

Why is this?

Thanks

P.S. When it comes to sorting, it appears that MacOS has no problem with 5 instead of 05 for May or 7 rather than 07 for the 7th day of the month. Has anyone found differently?
Processing: MacOS Catalina 10.15.7, Photo Mechanic 5216 (bafac3a), Capture One 20

File Formats: Leica DNG, Apple HEIC, TIFF, Sony RAW, JPEG, MOV

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 21953
    • View Profile
    • Camera Bits, Inc.
Re: Random Number Instead of Sequence Number
« Reply #1 on: October 23, 2020, 01:40:34 PM »
Rob,

I want to use a random number {rand100} instead of a sequence number {seqn} for a batch of photos. However, the "File > Rename Photos..." dialogue box won't let me use a random variable without also using the sequence variable. There are fewer than 100 photos in the batch. See screen capture below.

Why is this?

Because random numbers aren't guaranteed to avoid collisions in the naming.

-Kirk

Offline Rob Hedge

  • Newcomer
  • *
  • Posts: 17
    • View Profile
Re: Random Number Instead of Sequence Number
« Reply #2 on: October 23, 2020, 01:50:09 PM »
Because random numbers aren't guaranteed to avoid collisions in the naming.

-Kirk

Interesting. That's a pretty big limitation on the utility of random numbers. In this case, collision isn't possible unless random numbers can repeat. If possible repetition is the issue, a presumable solution would be to make them non-repeatable. If they already can't repeat, it would be nice if the user could make the decision about whether both are necessary.
Processing: MacOS Catalina 10.15.7, Photo Mechanic 5216 (bafac3a), Capture One 20

File Formats: Leica DNG, Apple HEIC, TIFF, Sony RAW, JPEG, MOV

Offline Rob Hedge

  • Newcomer
  • *
  • Posts: 17
    • View Profile
Re: Random Number Instead of Sequence Number
« Reply #3 on: October 23, 2020, 01:57:03 PM »
If I use both a random number and a sequence number, is it possible within PM to batch delete the sequence numbers later? If not, it may be possible to do that in MacOS using the Rename File function on a batch basis.
Processing: MacOS Catalina 10.15.7, Photo Mechanic 5216 (bafac3a), Capture One 20

File Formats: Leica DNG, Apple HEIC, TIFF, Sony RAW, JPEG, MOV

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 21953
    • View Profile
    • Camera Bits, Inc.
Re: Random Number Instead of Sequence Number
« Reply #4 on: October 23, 2020, 03:40:19 PM »
Rob,

Because random numbers aren't guaranteed to avoid collisions in the naming.

Interesting. That's a pretty big limitation on the utility of random numbers. In this case, collision isn't possible unless random numbers can repeat. If possible repetition is the issue, a presumable solution would be to make them non-repeatable. If they already can't repeat, it would be nice if the user could make the decision about whether both are necessary.

It could be improved for this usage, yes.

-Kirk

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 21953
    • View Profile
    • Camera Bits, Inc.
Re: Random Number Instead of Sequence Number
« Reply #5 on: October 23, 2020, 03:42:04 PM »
Rob,

If I use both a random number and a sequence number, is it possible within PM to batch delete the sequence numbers later? If not, it may be possible to do that in MacOS using the Rename File function on a batch basis.

Yes, you could use substring extraction when renaming to trim off the sequence numbers if you want.  https://docs.camerabits.com/support/solutions/articles/48001077381-variable-substring-extraction

HTH,

-Kirk

Offline Rob Hedge

  • Newcomer
  • *
  • Posts: 17
    • View Profile
Re: Random Number Instead of Sequence Number
« Reply #6 on: October 23, 2020, 04:45:56 PM »
Rob,

If I use both a random number and a sequence number, is it possible within PM to batch delete the sequence numbers later? If not, it may be possible to do that in MacOS using the Rename File function on a batch basis.

Yes, you could use substring extraction when renaming to trim off the sequence numbers if you want.  https://docs.camerabits.com/support/solutions/articles/48001077381-variable-substring-extraction

HTH,

-Kirk

Thanks Kirk. I'm trying to understand how variables work and you've just given me another practical example to try.

For anyone else reading this... If I had included time down to the second in the filename [e.g. {time}], File > Rename Photos would have accepted {rand100} without {seqn}.  Indeed, had I used {time}, neither {rand100} nor {seqn} would have been required. However, I didn't want to use time other than AM and PM.
Processing: MacOS Catalina 10.15.7, Photo Mechanic 5216 (bafac3a), Capture One 20

File Formats: Leica DNG, Apple HEIC, TIFF, Sony RAW, JPEG, MOV