I got an annoying behavior .
Under 10.4.11, I used a handler which behaved flawlessly.
Now, as my G5 died, I'm running 10.6.4 on my imac.
The handler fails.
--[SCRIPT]
my zipIt(("" & (path to desktop folder) & "azertyk.pages:") as alias)
--=====
on zipIt(fichier) (* fichier is an alias *)
local Nom, ext, dossier, nomZip, source, dest
tell application "System Events" to tell disk item (fichier as Unicode text)
set Nom to name
--> "azertyk.pages"
set ext to name extension
--> "pages"
set dossier to path of container
--> "Macintosh HD:Users:yvankoenig:Desktop:"
end tell
set Nom to text 1 thru -(2 + (count of ext)) of Nom
log Nom
set nomZip to Nom & (do shell script "date " & quote & "+_%Y%m%d-%H%M%S" & quote) & "." & ext & ".zip"
--> "azertyk_20101015-162446.pages.zip"
set source to quoted form of POSIX path of (fichier)
--> '/Users/yvankoenig/Desktop/azertyk.pages/'
set dest to dossier & nomZip
--> "Macintosh HD:Users:yvankoenig:Desktop:azertyk_20101015-162446.pages.zip"
tell application "System Events"
if exists disk item dest then delete disk item dest
(* worked under 10.4.11 bu fails under 10.6.4 *)
--make new file at end of folder dossier with properties {name:nomZip, kind:"ZIP archive"}
(* under 10.6.4, I tried this syntax but it faills too *)
--make new file at end of folder dossier with properties {name:nomZip, type identifier:"public.zip-archive"}
--> error "Erreur dans System Events : Le gestionnaire AppleEvent a échoué." number -10000
(* Happily, this one does the trick *)
make new file at end of folder dossier with properties {name:nomZip}
end tell
set dest to quoted form of POSIX path of dest
do shell script "ditto -ck " & source & " " & dest
end zipIt
--=====
--[/SCRIPT]