I'm new to the Mac OSX terminal and Unix in general. I wrote the batch file for windows where it works. I'd appreciate your help to do the same on Mac.
- I have a network folder, that contains a file original.ext
- I want to drag that file ($1) on a script (or a desktop icon)
- the script makes a copy of the file called temp.zip (same network folder)
- the script should then remove files from the archive (via 'zip -d')
- the script renames the modified temp.zip to the the original file name plus a prefix -> HD-original.ext
This is what i have so far, not sure if it works:
#!/bin/bash
cp "$1" temp.zip
zip -d temp.zip somefolder/*
mv temp.zip "HD-$1"
It seems I also need a '.desktop' file on the desktop that passes the drag&dropped file's path to the script (not sure if this works on Mac):
[Desktop Entry]
Name=Trim Archive
Exec=PATH_TO_SCRIPT_FILE %U
Type=Application