Smart archive extraction

@Mosed I was thinking you could do a whenexists when creating the folder but I don't think it is possible. So the 2 changes are possibly the best

Ah ok. In general this seems to be possible. I have to check if it works also for this script.

But as first step I added a new version where you can choose the "whenexists" value in the destination dialog. For single display there is no dialog, but the default value can be changed in the script (for both).

@Mosed If archive has a folder inside it does not matter which of the "Ask what to do" you pick you always get asked to rename the Folder.

Yes. I recognized now that it does not work when you have an archive with a folder inside. At least for the subfolders Opus ask to skip or replace.
But that behavior is identical to the original button. There you get also the prompt that the subfolder already exists.

I removed the new version. Has to be corrected somehow. I think it makes more sense to check if the root folder exist and to decide then to skip or overwrite everything or to rename the root folder.

@onedot3: I changed a lot now and added additional functions. According to my tests everything works, but I would say the button is in "beta" phase. I have to do some more tests to be sure.
Perhaps you want to test and give some suggestions or similar...

When a folder already exists only replace or skip works (together with "merge"). Thats the reason why there was a message when using rename for "whenexists".

Exctract V2.dcf (39.0 KB)

  • added a check if a folder with the archive name already exist (either in source or destination depening on users choise)
  • when using dual display the user can choose in the destination dialog for the case that a target folder already exist between "replace the folder, rename the existing folder, skip the archive, replace same-named files or skip same-named files.
    "replace the folder" means that the existing folder is deleted and then the archive is extracted / "rename the existing folder" means that the existing folder is renamed with a suffix (_old_date_time) and then the archive is extracted
  • when a target folder did exist the user gets at the end an overview which folders were affected by a change or which archive were skipped and the info if some selected files were not archives.
  • the message that some selected files are not archives does only appear when using single display mode or dual display mode, but the overview-message was not shown.
  • in single display mode the setting "rename existing folder" is the default behavior and cannot be changed via dialog (only by changing the code)

@Mosed You have called the .dcf Exctract an extra c after the x
It might be a good idea to add ss to the time HHmmss line 125 and 128
Because I was trying the same file quickly it failed because there was a old folder
Testz_old_220220_2130
Have a lot more test to try every option but looking good
When selecting ask to delete and the archive name is larger than the space in the dialogue message then some of the file name is missing. I made it double height so all the name shows.

ok. Yes - very long names are an issue also for the overview dialog. For the delete-dialog your proposal solves it.
I think I will replace the old warning dialog completely by the overview dialog. So if some existing folders were changed, an Archive was skipped or a non-archive file was chosen the overview dialog will be shown with the relevant information.

@fred I changed now more then only adding a delete promt. Shall I create an own topic with a link/reference to your button as basis for mine or do we want to give all users a choise between two different versions of smart exctraction button in this topic?

Your button script needs two updates in my opinion:

  • one curly bracket has to be moved from row 93 to row 84 to fix the issue, that the warning message does not appear. See also: Smart archive extraction - #8 by Mosed
  • WHENEXISTS=rename does not work for archives with subfolders (you get a warning from Opus that the subfolder already exist and you can choose between skip and replace). You can use WHENEXISTS=replace, merge or WHENEXISTS=skip, merge.

I collected my currently existing versions in this answer: Smart archive extraction - #10 by Mosed

Create your own thread and I will add a link to it in the first post and call my button as obsolete. I will partake in dev on your own solution regarding dialog location in french.

ok. I created a new topic. :slight_smile: