Le 24 avr. 07 à 17:26:49, KOENIG Yvan a écrit :
…
Hello
I got the tip some months ago on a forum:
set a_Folder to "Macintosh HD:Users:yvankoenig:Desktop:ƒ dates ƒ:AW_panther.pdf"
-- ... In the body of your script ...set aFolder to a_Folder as alias
-- This folder must existset myZippedPath to fileZipper(aFolder)
-- myZippedPath is now the path to the zipped file.
-- ... After the body of your script ...
-- File Zipper-- Creates zipped file in same folder-- Pass file/folder path to this handler-- Returns path to zipped fileon fileZipper(myFile)
if (myFile as text) ends with ":" then set myFile to text 1 thru -2 of (myFile as text)
set zipFile to (myFile & ".zip") as text
do shell script "/usr/bin/ditto -c -k -rsrc --keepParent " & (quoted form of (POSIX path of myFile)) & " " & (quoted form of (POSIX path of zipFile))
return zipFile
end fileZipper
Yvan KOENIG
Oops, something clobbered the message ;-((
set a_Folder to "Macintosh HD:Users:yvankoenig:Desktop:ƒ dates ƒ:AW_panther.pdf"
-- ... In the body of your script ...
set aFolder to a_Folder as alias
-- This folder must exist
set myZippedPath to fileZipper(aFolder)
-- myZippedPath is now the path to the zipped file.
-- ... After the body of your script ...
-- File Zipper
-- Creates zipped file in same folder
-- Pass file/folder path to this handler
-- Returns path to zipped file
on fileZipper(myFile)
if (myFile as text) ends with ":" then set myFile to text 1 thru -2 of (myFile as text)
set zipFile to (myFile & ".zip") as text
do shell script "/usr/bin/ditto -c -k -rsrc --keepParent " & (quoted form of (POSIX path of myFile)) & " " & (quoted form of (POSIX path of zipFile))
return zipFile
end fileZipper
Yvan KOENIG