• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to Archive/Compress an item or folder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Archive/Compress an item or folder?


  • Subject: Re: How to Archive/Compress an item or folder?
  • From: KOENIG Yvan <email@hidden>
  • Date: Tue, 18 Nov 2008 15:56:54 +0100


Le 18 nov. 2008 à 15:47, Dan Doughtie a écrit :

I want to write a simple script that takes a known folder, compresses it into a zip file then I use Cyberduck to FTP the zip file to a site.


I uses this handler (from info received here) daily.

--=============

on zipIt(f, oExt)
(* f is the pathname of the package (HFS format)
oExt is the original extension name of the package *)
local nom_de_f, dossier_de_f, stamp, n_zip, source, p_zip
set {nom_de_f, dossier_de_f} to my quelNomEtDossier(f)

if stampZip then
set stamp to my serialize()
else
set stamp to ""
end if
set n_zip to (text 1 thru -(2 + (length of oExt)) of nom_de_f) & stamp & "_" & oExt & ".zip"
set p_zip to dossier_de_f & n_zip

tell application "System Events"
if exists disk item p_zip then delete disk item p_zip
make new file at end of folder dossier_de_f with properties {name:n_zip}
end tell -- to System Events

set source to quoted form of POSIX path of f
set p_zip to quoted form of POSIX path of p_zip
do shell script "ditto -ck " & source & " " & p_zip
end zipIt


--=============

Yvan KOENIG (from FRANCE mardi 18 novembre 2008 15:56:35)


_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >How to Archive/Compress an item or folder? (From: Dan Doughtie <email@hidden>)

  • Prev by Date: Re: How to Archive/Compress an item or folder?
  • Next by Date: Re: Scripting KerberosAgent
  • Previous by thread: Re: How to Archive/Compress an item or folder?
  • Next by thread: Re: How to Archive/Compress an item or folder?
  • Index(es):
    • Date
    • Thread