Page 1 of 1

Zip selected files to an user button

Posted: 17 May 2018 14:07
by dotMastaz
Hello,

It's perhaps easy for you, and i don't find right answer to his forum but :
When i select files, i just want to click a user button (or shortcut) and zip (*.zip or .7zip) this selected files ?

Do you have a tuto ?

Thank you,
Nicolas

Re: Zip selected files to an user button

Posted: 17 May 2018 14:17
by jupe
You can do zip files natively with the SC zip_add() command, you can paste the following into the XY address bar for more information if you are interested:

Code: Select all

::help "idh_scripting_comref.htm#idh_sc_zip_add";
And for info on adding a custom toolbar button: https://www.xyplorer.com/release_8.40.php#ctb

Also if you just add #281; in the on left click field of a custom button it will prompt you for a zip filename to add the selected files to without having to customize it via scripting command I suggested previously.

If you want it to be a shortcut key instead, press the Jump button in the bottom of this dialog, https://www.xyplorer.com/highlights.php#cks
and type 281 and assign that "Add to Zip" function to a keyboard shortcut.

For 7z you will have to use the command line version of 7z, reply if you want an example of that.

Re: Zip selected files to an user button

Posted: 17 May 2018 16:00
by VeeGee
Thanks for the tips here jupe, very helpful. After reading this, I added a custom button w/#281 as the left click. I selected several files by CTRL+LEFTCLICKING them, clicked the toolbar button, the dialog popped up and I created the ZIP - very easy. However, when I selected the files by dragging the mouse over them and then clicking the custom toolbar button, nothing happens - no prompt for a filename. Not sure if this is intended or not as I am still experimenting with CTBs.
GIF.gif
GIF.gif (139.58 KiB) Viewed 2620 times

Re: Zip selected files to an user button

Posted: 17 May 2018 18:33
by Leito
I have the same behavior, seems like a bug.

The menu "File → File Special → Add to Zip" has no action when using the lasso selection or Ctrl+A.

Re: Zip selected files to an user button

Posted: 17 May 2018 19:33
by klownboy
Something strange is going on with the selection and using the that CTB, but it probably has nothing to do with the assigned CTB. I say strange because initially I could mouse select and and properly invoke the CTB, but then I couldn't. I haven't been able to nail down what conditions have changed to cause it not to work. When I restart XYplorer it works one time then it doesn't anymore on any subsequent attempts - if that helps anyone - using Windows 10 1803.

Re: Zip selected files to an user button

Posted: 18 May 2018 00:01
by jupe
Sorry guys, if you replace #281; with just zip_add(); it should work in the meantime and perform the same function until what seems like it could be a bug gets fixed.

Re: Zip selected files to an user button

Posted: 18 May 2018 09:29
by dotMastaz
Thank you Jupe, i add keyshortcut to File Special, Add to Zip !

Re: Zip selected files to an user button

Posted: 18 May 2018 09:33
by admin
Bug confirmed (not a new bug AFAIK, looks like it has been there for a long time). Fix coming...

Re: Zip selected files to an user button

Posted: 18 May 2018 13:53
by klownboy
It's working consistently now. :tup: