Zip selected files to an user button

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

Zip selected files to an user button

Postby dotMastaz » 17 May 2018 14:07

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: 483
Joined: 20 Oct 2017 21:14

Re: Zip selected files to an user button

Postby jupe » 17 May 2018 14:17

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
Posts: 106
Joined: 27 Jul 2015 20:00

Re: Zip selected files to an user button

Postby VeeGee » 17 May 2018 16:00

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 189 times

Leito
Posts: 143
Joined: 26 Sep 2016 15:37

Re: Zip selected files to an user button

Postby Leito » 17 May 2018 18:33

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: 2403
Joined: 28 Feb 2012 19:27

Re: Zip selected files to an user button

Postby klownboy » 17 May 2018 19:33

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.

jupe
Posts: 483
Joined: 20 Oct 2017 21:14

Re: Zip selected files to an user button

Postby jupe » 18 May 2018 00:01

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

Postby dotMastaz » 18 May 2018 09:29

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

admin
Site Admin
Posts: 44083
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1
Contact:

Re: Zip selected files to an user button

Postby admin » 18 May 2018 09:33

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

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

Re: Zip selected files to an user button

Postby klownboy » 18 May 2018 13:53

It's working consistently now. :tup:


Return to “Script Exchange”



Who is online

Users browsing this forum: No registered users and 1 guest