Would you mind helping me to change this Script to use bandizip to zip files ?

47 views
Skip to first unread message

Teemola (Teemo)

unread,
Mar 22, 2024, 11:38:49 PM3/22/24
to Bandizip for macOS
This karabiner-elements script rule help me to press 'z' in finder to zip the selected files,. however, it use 'zip' shell command, how to change it to use  bandizip ?

{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.finder$"
],
"type": "frontmost_application_if"
},
{
"name": "FINDER_INSERT_MODE",
"type": "variable_unless",
"value": true
},
{
"name": "FINDER_FIND_MODE",
"type": "variable_unless",
"value": true
}
],
"from": {
"key_code": "z"
},
"to": [
{
"shell_command": "SEL=$(osascript -e 'tell application \"Finder\" to POSIX path of (item 1 of (get selection) as text)')\nselection_count=$(osascript -e 'tell application \"Finder\" to count (selection as list)')\n\nif [[ -d \"$SEL\" && $selection_count -eq 1 ]] ; then\n cd \"$SEL\"\n foldername=$(basename \"$SEL\")\n zip -r \"../$foldername.zip\" .\n open -R \"../$foldername.zip\"\n\n current_vol=$(osascript -e 'output volume of (get volume settings)')\n vol_percent=$(echo \"scale=2 ; $current_vol / 100\" | bc) # afplay play with 100% volume by default\n (afplay --volume \"$vol_percent\" \"/System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/system/Volume Mount.aif\" &)\nelse\n osascript -e '\n tell application \"System Events\" to tell process \"Finder\"\n click menu item \"Compress\" of menu \"File\" of menu bar 1\n end tell'\nfi\n"
}
],
"type": "basic"
}

KH Kim

unread,
Mar 25, 2024, 2:52:47 AM3/25/24
to Teemola (Teemo), Bandizip for macOS
Hello, this Bandisoft.

Bandizip for Mac does not yet “officially” support command line mode, but you can create a compressed file using the command below in command line mode.

/Applications/Bandizip.app/Contents/MacOS/Bandizip c <archive file name> <source file name>

ex) /Applications/Bandizip.app/Contents/MacOS/Bandizip c /Users/user/Downloads/sample.zip /Users/user/Downloads/sample/

Please refer to the example above and modify the script.

We are sorry that we cannot provide direct help with the app's script.

Best regards,

2024년 3월 23일 (토) 오후 12:38, Teemola (Teemo) <simon....@gmail.com>님이 작성:
--
You received this message because you are subscribed to the Google Groups "Bandizip for macOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bandizip-mac...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bandizip-mac/558ca1c3-ba47-48ca-a372-780771e7bf56n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages