Can we 'tweak' the file renaming templates?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Biggynuff
Posts: 110
Joined: 13 May 2010 14:08

Can we 'tweak' the file renaming templates?

Post by Biggynuff »

Hi

I've found the renaming feature of XY to be very useful indeed for batch renaming huge numbers of images etc (holiday snaps - don't ya just love em! :lol: )

I was wondering if there was anyway of 'tweaking' the rename options that appear under the right click menu?

For instance, I have gathered quite a collection of regularly used 'batch rename' operations and 'search and replace' patterns that appear in the drop down box of the rename function. I just wondered if anyone has managed to give them a user-friendly name or have them appear on right click as your commonly used rename patterns?

The built in patterns on right click are great and the feature is superb, but it's just a thought about how this could be more user friendly and quicker to use

Any thoughts?

I did search on this and haven't found anything specific

Thanks

(I'm off to the sea-side for the day - my wife wants to take more pictures of 'crashy bangy' ocean . . . still, it gives me another excuse to spend time sorting out the files on XY !!!!! 8)

Don, this software is so good I'm sometimes disappointed that I can do things so quickly - how's that for irony :?: )


I am in love with XY . . . is she single?

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Can we 'tweak' the file renaming templates?

Post by j_c_hallgren »

Not sure if this helps or you already know this, but the prior 'batch rename' entries and such can at least be resequenced and/or cleaned up via the List Management function (and thus via the LM toolbar icon)...this can come in handy to reduce the clutter and move your most used ones to the top..
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

admin
Site Admin
Posts: 66350
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can we 'tweak' the file renaming templates?

Post by admin »

Biggynuff wrote:I am in love with XY . . . is she single?
Yes, but beware, she's very promiscuous...

You should dive a little into scripting. It's disappointingly easy :wink: to create a custom toolbar button that drops a menu with custom rename jobs...

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: Can we 'tweak' the file renaming templates?

Post by Muroph »

Biggynuff wrote:I have gathered quite a collection of regularly used 'batch rename' operations and 'search and replace' patterns that appear in the drop down box of the rename function. I just wondered if anyone has managed to give them a user-friendly name or have them appear on right click as your commonly used rename patterns?
i think the easiest solution is to create User Defined Commands for those rename patterns.
then you can assign a keyboard shortcut for them for quick access.
you can also create a Custom Toolbar Button with the command "#7;" to pop-up the "user -> rename" menu.

that's what i did with my 2 or 3 dozen favorite rename patterns. :)
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

Biggynuff
Posts: 110
Joined: 13 May 2010 14:08

Re: Can we 'tweak' the file renaming templates?

Post by Biggynuff »

Thanks guys,

Some excellent suggestions here

You're absolutely right Don, I must become more involved with scripting. I just have this in built fear every time I look at the smallest section of code . . . I dont know why but it just scares the life out of me having never programmed before!

admin
Site Admin
Posts: 66350
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can we 'tweak' the file renaming templates?

Post by admin »

Biggynuff wrote:Thanks guys,

Some excellent suggestions here

You're absolutely right Don, I must become more involved with scripting. I just have this in built fear every time I look at the smallest section of code . . . I dont know why but it just scares the life out of me having never programmed before!
Post 2 or 3 of your preferred rename jobs (patterns) and I post a copy and paste solution for a user button. From there you will be comfortable to expand...

Biggynuff
Posts: 110
Joined: 13 May 2010 14:08

Re: Can we 'tweak' the file renaming templates?

Post by Biggynuff »

Thank you Don,

I feel a bit silly now because I've realised that many of the suggestions above were things I should have found myself. Anyway, can't thank you guys enough

I've now prepared some of my common patterns as UDC's on the 'user' menu. Wonderful!

The thought of having some on a user defined button is very interesting indeed . . .

Here's a pattern I use for replacing common words with first letters in 'upper case' as part of filenames. It also replaces '_' with spaces etc. It's a 'search and replace':

_|.|And|Or|With|It|To|In|Of|The>> | |and|or|with|it|to|in|of|the (UDC: #1405;)

Another one I just love (and so simple in XY!). Just adds any text to the beginning of a file name. A 'batch' rename:

Text goes here - * (UDC: #1408;)

I use these A LOT. If you could give me an example of how to place these on a user button I'd be very grateful

Thanks all :?


.

admin
Site Admin
Posts: 66350
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can we 'tweak' the file renaming templates?

Post by admin »

Ok, here ya go.
1) Add a new User Button to the toolbar (you know how to do this?)
2) Copy the code below to the clipboard
3) right-click the new User Button in the toolbar; a dialog should open (if not select Edit... from the context menu).
4) right-click anywhere in the grey empty space of that dialog; then select Paste (see screenshot) and close the dialog.
5) done! select some testfile and try out the button...

Code: Select all

Snip: CTB 1
  XYplorer 9.20.0207, 13.07.2010 20:05:44
Name
  Biggynuff's Rename Button
Icon
  :rename
ScriptL
  "And > and, etc." rename "s", "_|.|And|Or|With|It|To|In|Of|The>> | |and|or|with|it|to|in|of|the"
  "Prefix Text" rename "b", "Text goes here - *"
  -
  "Append modified date" rename "b", '*-<datem yyyymmdd>'
ScriptR
  
FireClick
  1
To see the attached files, you need to log into the forum.

Biggynuff
Posts: 110
Joined: 13 May 2010 14:08

Re: Can we 'tweak' the file renaming templates?

Post by Biggynuff »

Don,

I am speechless :| . . . not just for the incredible power of XY but for your help and assistance

Thank you so much, it works wonderfully and I can easily modify it and add to it

I will take your advice and learn more about scripting. I really will try!

Thanks


.

Biggynuff
Posts: 110
Joined: 13 May 2010 14:08

Re: Can we 'tweak' the file renaming templates?

Post by Biggynuff »

Well . . .

I said I'd give it a go, so I gave it a go!

The script above is very nice and I can easily expand on it, but I thought "how nice would it be if my 'Prefix text' option could actually ask me what text I wanted to add at the start of the file name", rather than having to edit the script file each time?

Here goes:

Code: Select all

"And > and, etc." rename "s", "_|.|And|Or|With|It|To|In|Of|The>> | |and|or|with|it|to|in|of|the"
"Prefix Text" $string = input("Enter the text to prefix:"); rename "b", "$string*"
-
"Append modified date" rename "b", '*-<datem yyyymmdd>'
The part I've changed is the second line. It now opens a text input box, I type in the box and the string is allocated to a variable. I then use the variable as the 'argument' for the batch rename

This will no doubt seem simple to most readers here, but for me its a miracle of IT technology and a groundbreaking advance in my programming expertise :lol:

Of course, I can add as many 'pre set' text patterns to prefix as I like, along with other renaming options, but the above seems to work and I'm delighted with it as a first go 8)

Please, if anyone sees any glaring errors or pitfalls I've fallen into I'd be grateful for any comments

Should this be in the scripting section?

Anyway, thanks very much everyone :P


.

admin
Site Admin
Posts: 66350
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can we 'tweak' the file renaming templates?

Post by admin »

Wow! If that's really your first steps in programming you sure got talent! And you feel the fun of it. Beware, programming is highly addictive! :)

Biggynuff
Posts: 110
Joined: 13 May 2010 14:08

Re: Can we 'tweak' the file renaming templates?

Post by Biggynuff »

Ha Ha!

Thanks Don. I've had my head burried in your help file, the 'Wiki' web page and dissecting other users scripts on here for a few hours

It's gonna take some time but I'm determined to get into this more. I did some initial experimenting a while ago but never really got anything to work. I'm over the moon with this! :P

Thanks once again


8)

Biggynuff
Posts: 110
Joined: 13 May 2010 14:08

Re: Can we 'tweak' the file renaming templates?

Post by Biggynuff »

How about this?

Code: Select all

"And > and, etc." rename "s", "_|.|And|Or|With|It|To|In|Of|The>> | |and|or|with|it|to|in|of|the"
"Prefix Text" $string = input("Enter the text to prefix:"); rename "b", "$string*"
"Search and Replace" $find = input("Enter the text to be replaced:"); $replace = input("Enter the text to be inserted:"); msg "Replace: ".$find." with: ".$replace; rename "s", "$find/$replace"
-
"Append modified date" rename "b", '*-<datem yyyymmdd>'
I can highlight many files, click the button, select 'Search and Replace' then enter two text strings - one to find and one to replace it with. I then get a confirmation box before the files are renamed

Again, I'm sure it's just a trivial matter for XY but . . .

WWWWWOOOOOOOOWWWWWWWWWW!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :lol:

Must dash. I now have to learn how to present an 'ok' or 'cancel' option when the message with the strings is displayed. It's only a matter of time, and world domination is not that far off with XY :P


8)

admin
Site Admin
Posts: 66350
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can we 'tweak' the file renaming templates?

Post by admin »

:D

Tip: rename takes a 3rd argument "p" which gives you a preview before anything happens, e.g.

Code: Select all

rename "b", '*-<datem yyyymmdd>', "p"

Biggynuff
Posts: 110
Joined: 13 May 2010 14:08

Re: Can we 'tweak' the file renaming templates?

Post by Biggynuff »

:lol:

Works like a charm!

Thanks Don

Post Reply