Rename question again!

Ok, I had this all figured out once. But I lost a hard drive and this button was not backed up.

I have large directories.

I need to be able to click a button and do the following.

Select all files with a certain extension.

Rename all the selected files, change the extension actually.

Protect the renamed files.

Thanks.

You don't need to worry about selecting files if you want to rename from one fixed extension to another, just do something like this:

Rename FROM *.rm TO *.ram

Ok the rename portion works fine. But I have to hit the button a second time to make the files Read Only.

The button is:

Rename FROM *.123 to *.ABC
Select *.ABC
SetATTR ATTR+r

And the button is set as a MS-DOS Batch Function.

Hi Rex !
One way of accomplishing this is to write a DOS batch file.
Create a new file named RexRename.bat in a Text Editor ; notepad for instance.
The contents of RexRename.bat are then:

Attrib +r *.123
Ren *.123 *.ABC

After you have saved the batch file to a location you know,
make a button set as an MS-DOS Batch Function.
Then modify and use the command:

Path\To\RexRename.bat

:opusicon: porcupine
edit note :
And just maybe John Zeman won't catch me doing something here ! ( Joke )

Hi Rex,

With a little more thought, I realized that the RexRename.bat isn't needed here.
Try just using these DOS commands in a button set as an MS-DOS batch function.

Attrib +r *.123
Ren *.123 *.ABC

:opusicon: porcupine

Thanks.

I know I can do it that way but I did have a button set up in Opus using Opus commands to do it.

And stupid me I lost that button config. Now I'm trying to recreate the button and can't for the life of me figure out what I'm doing wrong.

Would this do it?

Select NONE
Select PATTERN *.123
Rename PATTERN . TO *.abc
@nodeselect
SetAttr ATTR +R

Depending on the number of files selected and being renamed... might it be that he is running into the whole 'timing' issue thing with executing multiple commands? Like we see when people try to perform multiple rename sweeps in one button?

I think the multiple line rename thing isn't a timing issue but to do with which files are and aren't left selected after each rename.

Hmm.. no answers.

I had this button set up once and now can't seem to get it to work.

It seems that Opus is running all commands at once. Is there a way to get it to run one command at a time?

I created a folder and copied 50 files of various extensions... cleared all attributes of these files... copied each file 10 times with auto-rename for a total of 550 files in the folder... renamed all from from ). to *).123... giving me 500 *.123 files... ran the following commands from a button:

sync:dopusrt /cmd Select *.123
sync:dopusrt /cmd SetAttr ATTR=r
sync:dopusrt /cmd Rename FROM *.123 to *.ABC

It didn't work :frowning: - I got a SetAttr error:

"An error occurred modifying 'schedlgu (10).123'
The system cannot find the file specified. (2)
"

I was hoping the sync:dopusrt would cause the rename command not to run until the SetAttr were all finished :frowning:. I then hit which undid the rename, and ran the button again and it worked fine. I guess the previous operation cached the files so that the subsequent SetAttr was able to finish real fast. I then tested against a different folder with 50 different files, but only made 2 copies of each file... running the button above worked the first time without any errors.

It would be OH SO HELPFUL if Opus could provide a rock-solid way of specifying how it should handle multiple command execution at least for it's own internal functions so that we could govern it 2 ways:

a) execute each command against all selected files, letting each command finish before the next command is started.
b) execute all commands against each selected file, letting all commands finish before the next selected file is processed.

[quote]It would be OH SO HELPFUL if Opus could provide a rock-solid way of specifying how it should handle multiple command execution at least for it's own internal functions so that we could govern it 2 ways:

a) execute each command against all selected files, letting each command finish before the next command is started.
b) execute all commands against each selected file, letting all commands finish before the next selected file is processed.[/quote]
Ditto Steje,

It's just wonderful when the simultaneous execution is useful.
This was very helpful with the Copy GUI in my PHP Album Archiver attempt for instance.

However, we really do need an option for an absolute exit code for DOpus functions .
Perhaps we could start another thread on this and some of the headaches and heartaches the lack of it has caused.

:opusicon: porcupine

Sorry, I'm a little confused. If I run this function without all the sync:dopusrt crap, it seems to work fine.

Try just:

Select *.123
SetAttr ATTR=r
Rename FROM *.123 TO *.ABC

[quote]Try just:

Select *.123 SetAttr ATTR=r Rename FROM *.123 TO *.ABC [/quote]

Ooops ! I hadn't actually tried it.
I assumed that if it didn't work for Steje, it wouldn't work for me.
I've run this several times now on 932 jpg's without any errors at all.

I had suggested the MS-Dos solution because it was simple and I knew it would work .

:opusicon: porcupine

'doh