INTERACT FORUM

Please login or register.

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

Author Topic: Shorten Filenames using expression  (Read 943 times)

jacobacci

  • Galactic Citizen
  • ****
  • Posts: 256
Shorten Filenames using expression
« on: May 20, 2018, 03:44:52 am »

Hi all
Here https://yabb.jriver.com/interact/index.php/topic,99917.0.html I had asked about an expression to shorten filenames. The recommended answer by marko was
=left(filepath()filename(,0),240).[file type]

I have tried to use the above expression to shorten file paths the other day. For the life of me I could not figure out how I had done that the last time around. Which field do I paste the expression to?
I cannot select the "Filename" field in the tagging pane if more than one track is selected?
Thanks a lot


Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Shorten Filenames using expression
« Reply #1 on: May 20, 2018, 04:27:36 am »

You'll have to use it in RMC (rename,move,copy)
Logged

jacobacci

  • Galactic Citizen
  • ****
  • Posts: 256
Re: Shorten Filenames using expression
« Reply #2 on: May 20, 2018, 05:11:40 am »

Thanks, ferday
I can't quite get it to work yet.
If I paste the expression into the directories field, it duplicates the filename (adds the full path to the existing filename)
If I paste it into the filename field, it duplicates the pathname.
Logged

ferday

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1732
Re: Shorten Filenames using expression
« Reply #3 on: May 20, 2018, 06:33:03 am »

I'm unsure how it ever worked before.  The only way to change a file on disk is with RMC.  The expression you posted would change it in a regular string field for a view, but you can't change anything there.  I say all that without testing so I could be wrong

I would think you'd have to check the length of filename (path) and remove that many characters from filename (name)
Logged

swiv3d

  • Guest
Re: Shorten Filenames using expression
« Reply #4 on: May 20, 2018, 08:52:30 am »

the expression =left(filename(,0),240) pasted into the filename section of RMC will shorten just the filename and leave the other parts of the filepath intact. change 240 to whatever you want the length to be. The filetype is not altered. If the filename is less tha the value stipulated it will show no change in the preview window.

As for selecting filename if more than one file is selected I don't understand that, I've just done exactly that with 12 files selected pasting left(filename(,0),2) 'the lack of an equals sign makes no difference' , which shortened all of the filenames to just 2 characters in the preview window.

Hope this helps
Logged

jacobacci

  • Galactic Citizen
  • ****
  • Posts: 256
Re: Shorten Filenames using expression
« Reply #5 on: May 22, 2018, 11:44:09 am »

Got it. The culprit was the = sign. Pasting just

left(filename(,0),240)


into the Filename section of RMC worked like a breeeze.

The issue with not being able to select the filename field when more than one file is selected was in the Tagging Pane at the left of the screen (the one that is selected with alt-enter)., not in the RMC tool.

Thanks a lot to all of you for getting me back on track.

Logged
Pages: [1]   Go Up