I am trying to use applescript to copy a folder to my desktop, zip, and then move the .zip file to another location, but I cannot get the zipping part to work.
I have searched everywhere for ways to pin a file / folder into applescript, and I don't know what I'm doing wrong, but none of them worked for me.
I also would not need to select a folder after copying it and a folder after zipping it, but I thought that I would leave them until it was fixed.
Any help at all would be appreciated.
This is my code: (updated after djbazziewazzie help)
set workspace to (path to desktop as text)
tell application "Finder"
display dialog "Select a folder to be zipped"
set inputFolder to choose folder
set inputFolderProperties to properties of inputFolder
set inputFolderName to name of inputFolder
duplicate inputFolder to workspace with properties
{name:inputFolderName}
display dialog "Select the folders desktop copy"
set copiedFile to choose folder
tell current application
set qpp to quoted form of POSIX path of copiedFile
do shell script "zip -r " & qpp & ".zip " & qpp
end tell
display dialog "Select the .zip file"
set zipFile to choose file
display dialog "Select the output folder"
set outputFolder to choose folder
move zipFile to outputFolder
end tell
source
share