Zip selected files to an user button

Discuss and share scripts and script files...
Post Reply
dotMastaz
Posts: 2
Joined: 17 May 2018 14:04

Zip selected files to an user button

Post 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

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Zip selected files to an user button

Post 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.

VeeGee

Re: Zip selected files to an user button

Post 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 2625 times

Leito
Posts: 561
Joined: 26 Sep 2016 15:37
Location: Windows 10 1809 x64

Re: Zip selected files to an user button

Post 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.

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Zip selected files to an user button

Post 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.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

jupe
Posts: 2757
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Zip selected files to an user button

Post 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.

dotMastaz
Posts: 2
Joined: 17 May 2018 14:04

Re: Zip selected files to an user button

Post by dotMastaz »

Thank you Jupe, i add keyshortcut to File Special, Add to Zip !

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

Re: Zip selected files to an user button

Post by admin »

Bug confirmed (not a new bug AFAIK, looks like it has been there for a long time). Fix coming...

klownboy
Posts: 4109
Joined: 28 Feb 2012 19:27

Re: Zip selected files to an user button

Post by klownboy »

It's working consistently now. :tup:
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Post Reply